(function (d) {
    elFinder = function (g, b) {
        function c(a, c) {
            a && e.view.win.width(a);
            c && e.view.nav.add(e.view.cwd).height(c)
        }
        function a() {
            c(null, e.dialog.height() - e.view.tlb.parent().height() - (d.browser.msie ? 47 : 32))
        }
        var e = this,
            h;
        this.log = function (a) {
            window.console && window.console.log && window.console.log(a)
        };
        this.options = d.extend({}, this.options, b || {});
        if (this.options.url) {
            this.id = "";
            if (h = d(g).attr("id")) this.id = h;
            this.version = "1.2";
            this.jquery = d.fn.jquery.split(".").join("");
            this.cwd = {};
            this.cdc = {};
            this.buffer = {};
            this.selected = [];
            this.history = [];
            this.locked = !1;
            this.zIndex = 2;
            this.dialog = null;
            this.anchor = this.options.docked ? d("<div/>").hide().insertBefore(g) : null;
            this.params = {
                dotFiles: !1,
                arc: "",
                uplMaxSize: ""
            };
            this.vCookie = "el-finder-view-" + this.id;
            this.pCookie = "el-finder-places-" + this.id;
            this.lCookie = "el-finder-last-" + this.id;
            this.view = new this.view(this, g);
            this.ui = new this.ui(this);
            this.eventsManager = new this.eventsManager(this);
            this.quickLook = new this.quickLook(this);
            this.cookie = function (a, c) {
                if (typeof c == "undefined") {
                    if (document.cookie && document.cookie != "") {
                        var b, e = document.cookie.split(";");
                        a += "=";
                        for (b = 0; b < e.length; b++) if (e[b] = d.trim(e[b]), e[b].substring(0, a.length) == a) return decodeURIComponent(e[b].substring(a.length))
                    }
                    return ""
                } else {
                    e = d.extend({}, this.options.cookie);
                    if (c === null) c = "", e.expires = -1;
                    if (typeof e.expires == "number") b = new Date, b.setTime(b.getTime() + e.expires * 864E5), e.expires = b;
                    document.cookie = a + "=" + encodeURIComponent(c) + "; expires=" + e.expires.toUTCString() + (e.path ? "; path=" + e.path : "") + (e.domain ? "; domain=" + e.domain : "") + (e.secure ? "; secure" : "")
                }
            };
            this.lock = function (a) {
                this.view.spinner(this.locked = a || !1);
                this.eventsManager.lock = this.locked
            };
            this.lockShortcuts = function (a) {
                this.eventsManager.lock = !! a
            };
            this.setView = function (a) {
                if (a == "list" || a == "icons") this.options.view = a, this.cookie(this.vCookie, a)
            };
            this.ajax = function (a, c, b) {
                var h = {
                    url: this.options.url,
                    async: !0,
                    type: "GET",
                    data: a,
                    dataType: "json",
                    cache: !1,
                    lock: !0,
                    force: !1,
                    silent: !1
                };
                typeof b == "object" && (h = d.extend({}, h, b));
                if (!h.silent) h.error = e.view.fatal;
                h.success = function (a) {
                    h.lock && e.lock();
                    if (a) {
                        a.debug && e.log(a.debug);
                        if (a.error && (!h.silent && e.view.error(a.error, a.errorData), !h.force)) return;
                        c(a);
                        delete a
                    }
                };
                h.lock && this.lock(!0);
                d.ajax(h)
            };
            this.tmb = function () {
                this.ajax({
                    cmd: "tmb",
                    current: e.cwd.hash
                }, function (a) {
                    if (e.options.view == "icons" && a.images && a.current == e.cwd.hash) {
                        for (var b in a.images) if (e.cdc[b]) e.cdc[b].tmb = a.images[b], d('div[key="' + b + '"]>p', e.view.cwd).css("background", ' url("' + a.images[b] + '") 0 0 no-repeat');
                        a.tmb && e.tmb()
                    }
                }, {
                    lock: !1,
                    silent: !0
                })
            };
            this.getPlaces = function () {
                var a = [],
                    b = this.cookie(this.pCookie);
                b.length && (b.indexOf(":") != -1 ? a = b.split(":") : a.push(b));
                return a
            };
            this.addPlace = function (a) {
                var b = this.getPlaces();
                if (d.inArray(a, b) == -1) return b.push(a), this.savePlaces(b), !0
            };
            this.removePlace = function (a) {
                var b = this.getPlaces();
                if (d.inArray(a, b) != -1) return this.savePlaces(d.map(b, function (b) {
                    return b == a ? null : b
                })), !0
            };
            this.savePlaces = function (a) {
                this.cookie(this.pCookie, a.join(":"))
            };
            this.reload = function (a) {
                var b;
                this.cwd = a.cwd;
                this.cdc = {};
                for (b = 0; b < a.cdc.length; b++) a.cdc[b].hash && a.cdc[b].name && (this.cdc[a.cdc[b].hash] = a.cdc[b], this.cwd.size += a.cdc[b].size);
                a.tree && (this.view.renderNav(a.tree), this.eventsManager.updateNav());
                this.updateCwd();
                a.tmb && !e.locked && e.options.view == "icons" && e.tmb();
                if (a.select && a.select.length) for (b = a.select.length; b--;) this.cdc[a.select[b]] && this.selectById(a.select[b]);
                this.lastDir(this.cwd.hash);
                if (this.options.autoReload > 0) this.iID && clearInterval(this.iID), this.iID = setInterval(function () {
                    !e.locked && e.ui.exec("reload")
                }, this.options.autoReload * 6E4)
            };
            this.updateCwd = function () {
                this.lockShortcuts(!0);
                this.selected = [];
                this.view.renderCwd();
                this.eventsManager.updateCwd();
                this.view.tree.find('a[key="' + this.cwd.hash + '"]').trigger("select");
                this.lockShortcuts()
            };
            this.drop = function (a, b, c) {
                if (b.helper.find('[key="' + c + '"]').length) return e.view.error("Unable to copy into itself");
                var h = [];
                b.helper.find('div:not(.noaccess):has(>label):not(:has(em[class="readonly"],em[class=""]))').each(function () {
                    h.push(d(this).hide().attr("key"))
                });
                b.helper.find("div:has(>label):visible").length || b.helper.hide();
                h.length ? (e.setBuffer(h, a.shiftKey ? 0 : 1, c), e.buffer.files && setTimeout(function () {
                    e.ui.exec("paste");
                    e.buffer = {}
                }, 300)) : d(this).removeClass("el-finder-droppable")
            };
            this.getSelected = function (a) {
                var b = [];
                if (a >= 0) return this.cdc[this.selected[a]] || {};
                for (a = 0; a < this.selected.length; a++) this.cdc[this.selected[a]] && b.push(this.cdc[this.selected[a]]);
                return b
            };
            this.select = function (a, b) {
                b && d(".ui-selected", e.view.cwd).removeClass("ui-selected");
                a.addClass("ui-selected");
                e.updateSelect()
            };
            this.selectById = function (a) {
                a = d('[key="' + a + '"]', this.view.cwd);
                a.length && (this.select(a), this.checkSelectedPos())
            };
            this.unselect = function (a) {
                a.removeClass("ui-selected");
                e.updateSelect()
            };
            this.toggleSelect = function (a) {
                a.toggleClass("ui-selected");
                this.updateSelect()
            };
            this.selectAll = function () {
                d("[key]", e.view.cwd).addClass("ui-selected");
                e.updateSelect()
            };
            this.unselectAll = function () {
                d(".ui-selected", e.view.cwd).removeClass("ui-selected");
                e.updateSelect()
            };
            this.updateSelect = function () {
                e.selected = [];
                d(".ui-selected", e.view.cwd).each(function () {
                    e.selected.push(d(this).attr("key"))
                });
                e.view.selectedInfo();
                e.ui.update();
                e.quickLook.update()
            };
            this.checkSelectedPos = function (a) {
                var b = e.view.cwd.find(".ui-selected:" + (a ? "last" : "first")).eq(0),
                    a = b.position(),
                    b = b.outerHeight(),
                    c = e.view.cwd.height();
                a.top < 0 ? e.view.cwd.scrollTop(a.top + e.view.cwd.scrollTop() - 2) : c - a.top < b && e.view.cwd.scrollTop(a.top + b - c + e.view.cwd.scrollTop())
            };
            this.setBuffer = function (a, b, c) {
                this.buffer = {
                    src: this.cwd.hash,
                    dst: c,
                    files: [],
                    names: [],
                    cut: b || 0
                };
                for (b = 0; b < a.length; b++) if (c = a[b], (c = this.cdc[c]) && c.read && c.type != "link") this.buffer.files.push(c.hash), this.buffer.names.push(c.name);
                if (!this.buffer.files.length) this.buffer = {}
            };
            this.isValidName = function (a) {
                return !this.cwd.dotFiles && a.indexOf(".") == 0 ? !1 : a.match(/^[^\\\/\<\>:]+$/)
            };
            this.fileExists = function (a) {
                for (var b in this.cdc) if (this.cdc[b].name == a) return b;
                return !1
            };
            this.uniqueName = function (a, b) {
                var c = a = e.i18n(a),
                    d = 0,
                    b = b || "";
                if (!this.fileExists(c + b)) return c + b;
                for (; d++ < 100;) if (!this.fileExists(c + d + b)) return c + d + b;
                return c.replace("100", "") + Math.random() + b
            };
            this.lastDir = function (a) {
                if (this.options.rememberLastDir) return a ? this.cookie(this.lCookie, a) : this.cookie(this.lCookie)
            };
            this.time = function () {
                return (new Date).getMilliseconds()
            };
            this.setView(this.cookie(this.vCookie));
            c(e.options.width, e.options.height);
            if (this.options.dialog || this.options.docked) this.options.dialog = d.extend({
                width: 570,
                dialogClass: "",
                minWidth: 480,
                minHeight: 330
            }, this.options.dialog || {}), this.options.dialog.open = function () {
                setTimeout(function () {
                    d('<input type="text" value="f"/>').appendTo(e.view.win).focus().select().remove()
                }, 200)
            }, this.options.dialog.dialogClass += "el-finder-dialog", this.options.dialog.resize = a, this.options.docked ? (this.options.dialog.close = function () {
                e.dock()
            }, this.view.win.data("size", {
                width: this.view.win.width(),
                height: this.view.nav.height()
            })) : (this.options.dialog.close = function () {
                e.destroy()
            }, this.dialog = d("<div/>").append(this.view.win).dialog(this.options.dialog));
            this.ajax({
                cmd: "open",
                target: this.lastDir() || "",
                init: !0,
                tree: !0
            }, function (a) {
                a.cwd && (e.eventsManager.init(), e.reload(a), d.extend(e.params, a.params || {}), d("*", document.body).each(function () {
                    var a = parseInt(d(this).css("z-index"));
                    if (a >= e.zIndex) e.zIndex = a + 1
                }), e.ui.init(a.disabled))
            }, {
                force: !0
            });
            this.open = function () {
                this.dialog ? this.dialog.dialog("open") : this.view.win.show();
                this.eventsManager.lock = !1
            };
            this.close = function () {
                this.quickLook.hide();
                this.options.docked && this.view.win.attr("undocked") ? this.dock() : this.dialog ? this.dialog.dialog("close") : this.view.win.hide();
                this.eventsManager.lock = !0
            };
            this.destroy = function () {
                this.eventsManager.lock = !0;
                this.quickLook.hide();
                this.quickLook.win.remove();
                this.dialog ? (this.dialog.dialog("destroy"), this.view.win.parent().remove()) : this.view.win.remove();
                this.ui.menu.remove()
            };
            this.dock = function () {
                if (this.options.docked && this.view.win.attr("undocked")) {
                    this.quickLook.hide();
                    var a = this.view.win.data("size");
                    this.view.win.insertAfter(this.anchor).removeAttr("undocked");
                    c(a.width, a.height);
                    this.dialog.dialog("destroy");
                    this.dialog = null
                }
            };
            this.undock = function () {
                if (this.options.docked && !this.view.win.attr("undocked")) this.quickLook.hide(), this.dialog = d("<div/>").append(this.view.win.css("width", "100%").attr("undocked", !0).show()).dialog(this.options.dialog), a()
            }
        } else alert("Invalid configuration! You have to set URL option.")
    };
    elFinder.prototype.i18n = function (d) {
        return this.options.i18n[this.options.lang] && this.options.i18n[this.options.lang][d] ? this.options.i18n[this.options.lang][d] : d
    };
    elFinder.prototype.options = {
        url: "",
        lang: "en",
        cssClass: "",
        wrap: 14,
        places: "Places",
        placesFirst: !0,
        editorCallback: null,
        cutURL: "",
        closeOnEditorCallback: !0,
        i18n: {},
        view: "icons",
        width: "",
        height: "",
        disableShortcuts: !1,
        rememberLastDir: !0,
        cookie: {
            expires: 30,
            domain: "",
            path: "/",
            secure: !1
        },
        toolbar: [
            ["back", "reload"],
            ["select", "open"],
            ["mkdir", "mkfile", "upload"],
            ["copy", "paste", "rm"],
            ["rename", "edit"],
            ["info", "quicklook", "resize"],
            ["icons", "list"],
            ["help"]
        ],
        contextmenu: {
            cwd: "reload,delim,mkdir,mkfile,upload,delim,paste,delim,info".split(","),
            file: "select,open,quicklook,delim,copy,cut,rm,delim,duplicate,rename,edit,resize,archive,extract,delim,info".split(","),
            group: "select,copy,cut,rm,delim,archive,extract,delim,info".split(",")
        },
        dialog: null,
        docked: !1,
        autoReload: 0,
        selectMultiple: !1
    };
    d.fn.elfinder = function (d) {
        return this.each(function () {
            var b = typeof d == "string" ? d : "";
            if (!this.elfinder) this.elfinder = new elFinder(this, typeof d == "object" ? d : {});
            switch (b) {
            case "close":
            case "hide":
                this.elfinder.close();
                break;
            case "open":
            case "show":
                this.elfinder.open();
                break;
            case "dock":
                this.elfinder.dock();
                break;
            case "undock":
                this.elfinder.undock();
                break;
            case "destroy":
                this.elfinder.destroy()
            }
        })
    }
})(jQuery);
(function (d) {
    elFinder.prototype.view = function (g, b) {
        var c = this;
        this.fm = g;
        this.kinds = {
            unknown: "Unknown",
            directory: "Folder",
            symlink: "Alias",
            "symlink-broken": "Broken alias",
            "application/x-empty": "Plain text",
            "application/postscript": "Postscript document",
            "application/octet-stream": "Application",
            "application/vnd.ms-office": "Microsoft Office document",
            "application/vnd.ms-word": "Microsoft Word document",
            "application/vnd.ms-excel": "Microsoft Excel document",
            "application/vnd.ms-powerpoint": "Microsoft Powerpoint presentation",
            "application/pdf": "Portable Document Format (PDF)",
            "application/vnd.oasis.opendocument.text": "Open Office document",
            "application/x-shockwave-flash": "Flash application",
            "application/xml": "XML document",
            "application/x-bittorrent": "Bittorrent file",
            "application/x-7z-compressed": "7z archive",
            "application/x-tar": "TAR archive",
            "application/x-gzip": "GZIP archive",
            "application/x-bzip2": "BZIP archive",
            "application/zip": "ZIP archive",
            "application/x-rar": "RAR archive",
            "application/javascript": "Javascript application",
            "text/plain": "Plain text",
            "text/x-php": "PHP source",
            "text/html": "HTML document",
            "text/javascript": "Javascript source",
            "text/css": "CSS style sheet",
            "text/rtf": "Rich Text Format (RTF)",
            "text/rtfd": "RTF with attachments (RTFD)",
            "text/x-c": "C source",
            "text/x-c++": "C++ source",
            "text/x-shellscript": "Unix shell script",
            "text/x-python": "Python source",
            "text/x-java": "Java source",
            "text/x-ruby": "Ruby source",
            "text/x-perl": "Perl script",
            "text/xml": "XML document",
            "image/x-ms-bmp": "BMP image",
            "image/jpeg": "JPEG image",
            "image/gif": "GIF Image",
            "image/png": "PNG image",
            "image/x-targa": "TGA image",
            "image/tiff": "TIFF image",
            "image/vnd.adobe.photoshop": "Adobe Photoshop image",
            "audio/mpeg": "MPEG audio",
            "audio/midi": "MIDI audio",
            "audio/ogg": "Ogg Vorbis audio",
            "audio/mp4": "MP4 audio",
            "audio/wav": "WAV audio",
            "video/x-dv": "DV video",
            "video/mp4": "MP4 video",
            "video/mpeg": "MPEG video",
            "video/x-msvideo": "AVI video",
            "video/quicktime": "Quicktime video",
            "video/x-ms-wmv": "WM video",
            "video/x-flv": "Flash video",
            "video/x-matroska": "Matroska video"
        };
        this.tlb = d("<ul />");
        this.nav = d('<div class="el-finder-nav"/>').resizable({
            handles: "e",
            autoHide: !0,
            minWidth: 200,
            maxWidth: 500
        });
        this.cwd = d('<div class="el-finder-cwd"/>').attr("unselectable", "on");
        this.spn = d('<div class="el-finder-spinner"/>');
        this.err = d('<p class="el-finder-err"><strong/></p>').click(function () {
            d(this).hide()
        });
        this.nfo = d('<div class="el-finder-stat"/>');
        this.pth = d('<div class="el-finder-path"/>');
        this.sel = d('<div class="el-finder-sel"/>');
        this.stb = d('<div class="el-finder-statusbar"/>').append(this.pth).append(this.nfo).append(this.sel);
        this.wrz = d('<div class="el-finder-workzone" />').append(this.nav).append(this.cwd).append(this.spn).append(this.err).append('<div style="clear:both" />');
        this.win = d(b).empty().attr("id", this.fm.id).addClass("el-finder " + (g.options.cssClass || "")).append(d('<div class="el-finder-toolbar" />').append(this.tlb)).append(this.wrz).append(this.stb);
        this.tree = d('<ul class="el-finder-tree"></ul>').appendTo(this.nav);
        this.plc = d('<ul class="el-finder-places"><li><a href="#" class="el-finder-places-root"><div/>' + this.fm.i18n(this.fm.options.places) + "</a><ul/></li></ul>").hide();
        this.nav[this.fm.options.placesFirst ? "prepend" : "append"](this.plc);
        this.spinner = function (a) {
            this.win.toggleClass("el-finder-disabled", a);
            this.spn.toggle(a)
        };
        this.fatal = function (a) {
            c.error(a.status != "404" ? "Invalid backend configuration" : "Unable to connect to backend")
        };
        this.error = function (a, b) {
            this.fm.lock();
            this.err.show().children("strong").html(this.fm.i18n(a) + "!" + this.formatErrorData(b));
            setTimeout(function () {
                c.err.fadeOut("slow")
            }, 4E3)
        };
        this.renderNav = function (a) {
            function b(a) {
                var c, d, h = '<ul style="display:none">';
                for (c = 0; c < a.length; c++) a[c].name && a[c].hash && (d = "", !a[c].read && !a[c].write ? d = "noaccess" : a[c].read ? a[c].write || (d = "readonly") : d = "dropbox", h += '<li><a href="#" class="' + d + '" key="' + a[c].hash + '"><div' + (a[c].dirs.length ? ' class="collapsed"' : "") + "/>" + a[c].name + "</a>", a[c].dirs.length && (h += b(a[c].dirs)), h += "</li>");
                return h + "</ul>"
            }
            var c = a.dirs.length ? b(a.dirs) : "";
            this.tree.html('<li><a href="#" class="el-finder-tree-root" key="' + a.hash + '"><div' + (c ? ' class="collapsed expanded"' : "") + "/>" + a.name + "</a>" + c + "</li>");
            this.fm.options.places && this.renderPlaces()
        };
        this.renderPlaces = function () {
            var a, b, h = this.fm.getPlaces(),
                j = this.plc.show().find("ul").empty().hide();
            d("div:first", this.plc).removeClass("collapsed expanded");
            if (h.length) {
                h.sort(function (a, b) {
                    var d = c.tree.find('a[key="' + a + '"]').text() || "",
                        h = c.tree.find('a[key="' + b + '"]').text() || "";
                    return d.localeCompare(h)
                });
                for (a = 0; a < h.length; a++)(b = this.tree.find('a[key="' + h[a] + '"]:not(.dropbox)').parent()) && b.length ? j.append(b.clone().children("ul").remove().end().find("div").removeClass("collapsed expanded").end()) : this.fm.removePlace(h[a]);
                j.children().length && d("div:first", this.plc).addClass("collapsed")
            }
        };
        this.renderCwd = function () {
            this.cwd.empty();
            var a = 0,
                b = 0,
                c = "",
                d;
            for (d in this.fm.cdc) a++, b += this.fm.cdc[d].size, c += this.fm.options.view == "icons" ? this.renderIcon(this.fm.cdc[d]) : this.renderRow(this.fm.cdc[d], a % 2);
            this.fm.options.view == "icons" ? this.cwd.append(c) : this.cwd.append('<table><tr><th colspan="2">' + this.fm.i18n("Name") + "</th><th>" + this.fm.i18n("Permissions") + "</th><th>" + this.fm.i18n("Modified") + '</th><th class="size">' + this.fm.i18n("Size") + "</th><th>" + this.fm.i18n("Kind") + "</th></tr>" + c + "</table>");
            this.pth.text(g.cwd.rel);
            this.nfo.text(g.i18n("items") + ": " + a + ", " + this.formatSize(b));
            this.sel.empty()
        };
        this.renderIcon = function (a) {
            var b = "<p" + (a.tmb ? " style=\"background:url('" + a.tmb + "') 0 0 no-repeat\"" : "") + "/><label>" + this.formatName(a.name) + "</label>";
            if (a.link || a.mime == "symlink-broken") b += "<em/>";
            !a.read && !a.write ? b += '<em class="noaccess"/>' : a.read && !a.write ? b += '<em class="readonly"/>' : !a.read && a.write && (b += '<em class="' + (a.mime == "directory" ? "dropbox" : "noread") + '" />');
            return '<div class="' + this.mime2class(a.mime) + '" key="' + a.hash + '">' + b + "</div>"
        };
        this.renderRow = function (a, b) {
            var d = a.link || a.mime == "symlink-broken" ? "<em/>" : "";
            !a.read && !a.write ? d += '<em class="noaccess"/>' : a.read && !a.write ? d += '<em class="readonly"/>' : !a.read && a.write && (d += '<em class="' + (a.mime == "directory" ? "dropbox" : "noread") + '" />');
            return '<tr key="' + a.hash + '" class="' + c.mime2class(a.mime) + (b ? " el-finder-row-odd" : "") + '"><td class="icon"><p>' + d + "</p></td><td>" + a.name + "</td><td>" + c.formatPermissions(a.read, a.write, a.rm) + "</td><td>" + c.formatDate(a.date) + '</td><td class="size">' + c.formatSize(a.size) + "</td><td>" + c.mime2kind(a.link ? "symlink" : a.mime) + "</td></tr>"
        };
        this.updateFile = function (a) {
            var b = this.cwd.find('[key="' + a.hash + '"]');
            b.replaceWith(b[0].nodeName == "DIV" ? this.renderIcon(a) : this.renderRow(a))
        };
        this.selectedInfo = function () {
            var a, b = 0,
                d;
            if (c.fm.selected.length) {
                d = this.fm.getSelected();
                for (a = 0; a < d.length; a++) b += d[a].size
            }
            this.sel.text(a > 0 ? this.fm.i18n("selected items") + ": " + d.length + ", " + this.formatSize(b) : "")
        };
        this.formatName = function (a) {
            var b = c.fm.options.wrap;
            if (b > 0) if (a.length > b * 2) return a.substr(0, b) + "&shy;" + a.substr(b, b - 5) + "&hellip;" + a.substr(a.length - 3);
            else if (a.length > b) return a.substr(0, b) + "&shy;" + a.substr(b);
            return a
        };
        this.formatErrorData = function (a) {
            var b, d = "";
            if (typeof a == "object") for (b in d = "<br />", a) d += b + " " + c.fm.i18n(a[b]) + "<br />";
            return d
        };
        this.mime2class = function (a) {
            return a.replace("/", " ").replace(/\./g, "-")
        };
        this.formatDate = function (a) {
            return a.replace(/([a-z]+)\s/i, function (a, b) {
                return c.fm.i18n(b) + " "
            })
        };
        this.formatSize = function (a) {
            var b = 1,
                c = "bytes";
            a > 1073741824 ? (b = 1073741824, c = "Gb") : a > 1048576 ? (b = 1048576, c = "Mb") : a > 1024 && (b = 1024, c = "Kb");
            return Math.round(a / b) + " " + c
        };
        this.formatPermissions = function (a, b, d) {
            var j = [];
            a && j.push(c.fm.i18n("read"));
            b && j.push(c.fm.i18n("write"));
            d && j.push(c.fm.i18n("remove"));
            return j.join("/")
        };
        this.mime2kind = function (a) {
            return this.fm.i18n(this.kinds[a] || "unknown")
        }
    }
})(jQuery);
(function (d) {
    elFinder.prototype.ui = function (g) {
        var b = this;
        this.fm = g;
        this.cmd = {};
        this.buttons = {};
        this.menu = d('<div class="el-finder-contextmenu" />').appendTo(document.body).hide();
        this.dockButton = d('<div class="el-finder-dock-button" title="' + b.fm.i18n("Dock/undock filemanager window") + '" />');
        this.exec = function (b, a) {
            if (this.cmd[b]) {
                if (b != "open" && !this.cmd[b].isAllowed()) return this.fm.view.error("Command not allowed");
                this.fm.locked || (this.fm.quickLook.hide(), d(".el-finder-info").remove(), this.cmd[b].exec(a), this.update())
            }
        };
        this.cmdName = function (b) {
            return this.cmd[b] && this.cmd[b].name ? b == "archive" && this.fm.params.archives.length == 1 ? this.fm.i18n("Create") + " " + this.fm.view.mime2kind(this.fm.params.archives[0]).toLowerCase() : this.fm.i18n(this.cmd[b].name) : b
        };
        this.isCmdAllowed = function (c) {
            return b.cmd[c] && b.cmd[c].isAllowed()
        };
        this.execIfAllowed = function (b) {
            this.isCmdAllowed(b) && this.exec(b)
        };
        this.includeInCm = function (b, a) {
            return this.isCmdAllowed(b) && this.cmd[b].cm(a)
        };
        this.showMenu = function (c) {
            var a, e, h, j, g;
            this.hideMenu();
            (function (a) {
                var c, d, h, j, e = b.fm.options.contextmenu[a] || [];
                for (c = 0; c < e.length; c++) if (e[c] == "delim") b.menu.children().length && !b.menu.children(":last").hasClass("delim") && b.menu.append('<div class="delim" />');
                else if (b.fm.ui.includeInCm(e[c], a)) {
                    h = b.cmd[e[c]].argc();
                    j = "";
                    if (h.length) {
                        j = '<span/><div class="el-finder-contextmenu-sub" style="z-index:' + (parseInt(b.menu.css("z-index")) + 1) + '">';
                        for (d = 0; d < h.length; d++) j += '<div name="' + e[c] + '" argc="' + h[d].argc + '" class="' + h[d]["class"] + '">' + h[d].text + "</div>";
                        j += "</div>"
                    }
                    b.menu.append('<div class="' + e[c] + '" name="' + e[c] + '">' + j + b.cmdName(e[c]) + "</div>")
                }
            })(b.fm.selected.length ? b.fm.selected.length == 1 ? "file" : "group" : "cwd");
            h = d(window);
            a = h.height();
            e = h.width();
            h = h.scrollTop();
            j = this.menu.width();
            g = this.menu.height();
            this.menu.css({
                left: c.clientX + j > e ? c.clientX - j : c.clientX,
                top: c.clientY + g > a && c.clientY > g ? c.clientY + h - g : c.clientY + h
            }).show().find("div[name]").hover(function () {
                var a = d(this),
                    b = a.children("div"),
                    c;
                a.addClass("hover");
                b.length && (b.attr("pos") || (c = a.outerWidth(), b.css(d(window).width() - c - a.offset().left > b.width() ? "left" : "right", c - 5).attr("pos", !0)), b.show())
            }, function () {
                d(this).removeClass("hover").children("div").hide()
            }).click(function (a) {
                a.stopPropagation();
                a = d(this);
                a.children("div").length || (b.hideMenu(), b.exec(a.attr("name"), a.attr("argc")))
            })
        };
        this.hideMenu = function () {
            this.menu.hide().empty()
        };
        this.update = function () {
            for (var b in this.buttons) this.buttons[b].toggleClass("disabled", !this.cmd[b].isAllowed())
        };
        this.init = function (c) {
            var a, e, h = !1,
                j = this.fm.options.toolbar;
            this.fm.options.editorCallback || c.push("select");
            !this.fm.params.archives.length && d.inArray("archive", c) == -1 && c.push("archive");
            for (a in this.commands) if (d.inArray(a, c) == -1) this.commands[a].prototype = this.command.prototype, this.cmd[a] = new this.commands[a](this.fm);
            for (a = 0; a < j.length; a++) {
                h && this.fm.view.tlb.append('<li class="delim" />');
                h = !1;
                for (c = 0; c < j[a].length; c++) e = j[a][c], this.cmd[e] && (h = !0, this.buttons[e] = d('<li class="' + e + '" title="' + this.cmdName(e) + '" name="' + e + '" />').appendTo(this.fm.view.tlb).click(function (a) {
                    a.stopPropagation()
                }).bind("click", function (a) {
                    return function () {
                        !d(this).hasClass("disabled") && a.exec(d(this).attr("name"))
                    }
                }(this)).hover(function () {
                    !d(this).hasClass("disabled") && d(this).addClass("el-finder-tb-hover")
                }, function () {
                    d(this).removeClass("el-finder-tb-hover")
                }))
            }
            this.update();
            this.menu.css("z-index", this.fm.zIndex);
            this.fm.options.docked && this.dockButton.hover(function () {
                d(this).addClass("el-finder-dock-button-hover")
            }, function () {
                d(this).removeClass("el-finder-dock-button-hover")
            }).click(function () {
                b.fm.view.win.attr("undocked") ? b.fm.dock() : b.fm.undock();
                d(this).trigger("mouseout")
            }).prependTo(this.fm.view.tlb)
        }
    };
    elFinder.prototype.ui.prototype.command = function () {};
    elFinder.prototype.ui.prototype.command.prototype.isAllowed = function () {
        return !0
    };
    elFinder.prototype.ui.prototype.command.prototype.cm = function () {
        return !1
    };
    elFinder.prototype.ui.prototype.command.prototype.argc = function () {
        return []
    };
    elFinder.prototype.ui.prototype.commands = {
        back: function (d) {
            var b = this;
            this.name = "Back";
            this.fm = d;
            this.exec = function () {
                this.fm.history.length && this.fm.ajax({
                    cmd: "open",
                    target: this.fm.history.pop()
                }, function (c) {
                    b.fm.reload(c)
                })
            };
            this.isAllowed = function () {
                return this.fm.history.length
            }
        },
        reload: function (d) {
            var b = this;
            this.name = "Reload";
            this.fm = d;
            this.exec = function () {
                this.fm.ajax({
                    cmd: "open",
                    target: this.fm.cwd.hash,
                    tree: !0
                }, function (c) {
                    b.fm.reload(c)
                })
            };
            this.cm = function (b) {
                return b == "cwd"
            }
        },
        open: function (g) {
            var b = this;
            this.name = "Open";
            this.fm = g;
            this.exec = function (c) {
                function a(a) {
                    b.fm.history.push(b.fm.cwd.hash);
                    b.fm.ajax({
                        cmd: "open",
                        target: a
                    }, function (a) {
                        b.fm.reload(a)
                    })
                }
                function e(a) {
                    var c;
                    c = "";
                    a.dim && (c = a.dim.split("x"), c = "width=" + (parseInt(c[0]) + 20) + ",height=" + (parseInt(c[1]) + 20) + ",");
                    window.open(a.url || b.fm.options.url + "?cmd=open&current=" + (a.parent || b.fm.cwd.hash) + "&target=" + (a.link || a.hash), !1, "top=50,left=50," + c + "scrollbars=yes,resizable=yes")
                }
                var h = null,
                    h = c ? {
                        hash: d(c).attr("key"),
                        mime: "directory",
                        read: !d(c).hasClass("noaccess") && !d(c).hasClass("dropbox")
                    } : this.fm.getSelected(0);
                if (h.hash) {
                    if (!h.read) return this.fm.view.error("Access denied");
                    if (h.type == "link" && !h.link) return this.fm.view.error("Unable to open broken link");
                    h.mime == "directory" ? a(h.link || h.hash) : e(h)
                }
            };
            this.isAllowed = function () {
                return this.fm.selected.length == 1 && this.fm.getSelected(0).read
            };
            this.cm = function (b) {
                return b == "file"
            }
        },
        select: function (g) {
            this.name = "Select file";
            this.fm = g;
            this.exec = g.options.selectMultiple ?
            function () {
                var b = d(g.getSelected()).map(function () {
                    return g.options.cutURL == "root" ? this.url.substr(g.params.url.length) : this.url.replace(RegExp("^(" + g.options.cutURL + ")"), "")
                });
                g.options.editorCallback(b);
                g.options.closeOnEditorCallback && (g.dock(), g.close())
            } : function () {
                var b = this.fm.getSelected(0);
                if (!b.url) return this.fm.view.error("File URL disabled by connector config");
                this.fm.options.editorCallback(this.fm.options.cutURL == "root" ? b.url.substr(this.fm.params.url.length) : b.url.replace(RegExp("^(" + this.fm.options.cutURL + ")"), ""));
                this.fm.options.closeOnEditorCallback && (this.fm.dock(), this.fm.close(), this.fm.destroy())
            };
            this.isAllowed = function () {
                return (this.fm.options.selectMultiple && this.fm.selected.length >= 1 || this.fm.selected.length == 1) && !/(symlink\-broken|directory)/.test(this.fm.getSelected(0).mime)
            };
            this.cm = function (b) {
                return b != "cwd"
            }
        },
        quicklook: function (d) {
            var b = this;
            this.name = "Preview with Quick Look";
            this.fm = d;
            this.exec = function () {
                b.fm.quickLook.toggle()
            };
            this.isAllowed = function () {
                return this.fm.selected.length == 1
            };
            this.cm = function () {
                return !0
            }
        },
        info: function (g) {
            var b = this;
            this.name = "Get info";
            this.fm = g;
            this.exec = function () {
                function c(c) {
                    var g = ["50%", "50%"],
                        i, l = '<table cellspacing="0"><tr><td>' + b.fm.i18n("Name") + "</td><td>" + c.name + "</td></tr><tr><td>" + b.fm.i18n("Kind") + "</td><td>" + b.fm.view.mime2kind(c.link ? "symlink" : c.mime) + "</td></tr><tr><td>" + b.fm.i18n("Size") + "</td><td>" + b.fm.view.formatSize(c.size) + "</td></tr><tr><td>" + b.fm.i18n("Modified") + "</td><td>" + b.fm.view.formatDate(c.date) + "</td></tr><tr><td>" + b.fm.i18n("Permissions") + "</td><td>" + b.fm.view.formatPermissions(c.read, c.write, c.rm) + "</td></tr>";
                    c.link && (l += "<tr><td>" + b.fm.i18n("Link to") + "</td><td>" + c.linkTo + "</td></tr>");
                    c.dim && (l += "<tr><td>" + b.fm.i18n("Dimensions") + "</td><td>" + c.dim + " px.</td></tr>");
                    c.url && (l += "<tr><td>" + b.fm.i18n("URL") + '</td><td><a href="' + c.url + '" target="_blank">' + c.url + "</a></td></tr>");
                    a > 1 && (i = d(".el-finder-dialog-info:last"), i.length ? (g = i.offset().left + 10, i = i.offset().top + 10, g = [g < e - 350 ? g : 20, i < h - 300 ? i : 20]) : (g = Math.round((e - 350) / 2 - a * 10), i = Math.round((h - 300) / 2 - a * 10), g = [g > 20 ? g : 20, i > 20 ? i : 20]));
                    d("<div />").append(l + "</table>").dialog({
                        dialogClass: "el-finder-dialog el-finder-dialog-info",
                        width: 390,
                        position: g,
                        title: b.fm.i18n(c.mime == "directory" ? "Folder info" : "File info"),
                        close: function () {
                            --a <= 0 && b.fm.lockShortcuts();
                            d(this).dialog("destroy")
                        },
                        buttons: {
                            Ok: function () {
                                d(this).dialog("close")
                            }
                        }
                    })
                }
                var a = this.fm.selected.length,
                    e = d(window).width(),
                    h = d(window).height();
                this.fm.lockShortcuts(!0);
                a ? d.each(this.fm.getSelected(), function () {
                    c(this)
                }) : c(b.fm.cwd)
            };
            this.cm = function () {
                return !0
            }
        },
        rename: function (g) {
            var b = this;
            this.name = "Rename";
            this.fm = g;
            this.exec = function () {
                function c() {
                    g.html(l);
                    b.fm.lockShortcuts()
                }
                function a() {
                    if (!b.fm.locked) {
                        var a, d = k.val();
                        if (i.name == k.val()) return c();
                        b.fm.isValidName(d) ? b.fm.fileExists(d) && (a = "File or folder with the same name already exists") : a = "Invalid name";
                        if (a) return b.fm.view.error(a), h.addClass("ui-selected"), b.fm.lockShortcuts(!0), k.select().focus();
                        b.fm.ajax({
                            cmd: "rename",
                            current: b.fm.cwd.hash,
                            target: i.hash,
                            name: d
                        }, function (a) {
                            a.error ? c() : (i.mime == "directory" && b.fm.removePlace(i.hash) && b.fm.addPlace(a.target), b.fm.reload(a))
                        }, {
                            force: !0
                        })
                    }
                }
                var e = this.fm.getSelected(),
                    h, g, k, i, l;
                e.length == 1 && (i = e[0], h = this.fm.view.cwd.find('[key="' + i.hash + '"]'), g = this.fm.options.view == "icons" ? h.children("label") : h.find("td").eq(1), l = g.html(), k = d('<input type="text" />').val(i.name).appendTo(g.empty()).bind("change blur", a).keydown(function (a) {
                    a.stopPropagation();
                    a.keyCode == 27 ? c() : a.keyCode == 13 && (i.name == k.val() ? c() : d(this).trigger("change"))
                }).click(function (a) {
                    a.stopPropagation()
                }).select().focus(), this.fm.lockShortcuts(!0))
            };
            this.isAllowed = function () {
                return this.fm.cwd.write && this.fm.getSelected(0).write
            };
            this.cm = function (b) {
                return b == "file"
            }
        },
        copy: function (d) {
            this.name = "Copy";
            this.fm = d;
            this.exec = function () {
                this.fm.setBuffer(this.fm.selected)
            };
            this.isAllowed = function () {
                if (this.fm.selected.length) for (var b = this.fm.getSelected(), c = b.length; c--;) if (b[c].read) return !0;
                return !1
            };
            this.cm = function (b) {
                return b != "cwd"
            }
        },
        cut: function (d) {
            this.name = "Cut";
            this.fm = d;
            this.exec = function () {
                this.fm.setBuffer(this.fm.selected, 1)
            };
            this.isAllowed = function () {
                if (this.fm.selected.length) for (var b = this.fm.getSelected(), c = b.length; c--;) if (b[c].read && b[c].rm) return !0;
                return !1
            };
            this.cm = function (b) {
                return b != "cwd"
            }
        },
        paste: function (d) {
            var b = this;
            this.name = "Paste";
            this.fm = d;
            this.exec = function () {
                var c;
                if (!this.fm.buffer.dst) this.fm.buffer.dst = this.fm.cwd.hash;
                c = this.fm.view.tree.find('[key="' + this.fm.buffer.dst + '"]');
                if (!c.length || c.hasClass("noaccess") || c.hasClass("readonly")) return this.fm.view.error("Access denied");
                if (this.fm.buffer.src == this.fm.buffer.dst) return this.fm.view.error("Unable to copy into itself");
                c = {
                    cmd: "paste",
                    current: this.fm.cwd.hash,
                    src: this.fm.buffer.src,
                    dst: this.fm.buffer.dst,
                    cut: this.fm.buffer.cut
                };
                this.fm.jquery > 132 ? c.targets = this.fm.buffer.files : c["targets[]"] = this.fm.buffer.files;
                this.fm.ajax(c, function (a) {
                    a.cdc && b.fm.reload(a)
                }, {
                    force: !0
                })
            };
            this.isAllowed = function () {
                return this.fm.buffer.files
            };
            this.cm = function (b) {
                return b == "cwd"
            }
        },
        rm: function (g) {
            var b = this;
            this.name = "Remove";
            this.fm = g;
            this.exec = function () {
                var c, a = [],
                    e = this.fm.getSelected();
                for (c = 0; c < e.length; c++) {
                    if (!e[c].rm) return this.fm.view.error(e[c].name + ": " + this.fm.i18n("Access denied"));
                    a.push(e[c].hash)
                }
                a.length && (this.fm.lockShortcuts(!0), d('<div><div class="ui-state-error ui-corner-all"><span class="ui-icon ui-icon-alert"/><strong>' + this.fm.i18n("Are you sure you want to remove files?<br /> This cannot be undone!") + "</strong></div></div>").dialog({
                    title: this.fm.i18n("Confirmation required"),
                    dialogClass: "el-finder-dialog",
                    width: 350,
                    close: function () {
                        b.fm.lockShortcuts()
                    },
                    buttons: {
                        Cancel: function () {
                            d(this).dialog("close")
                        },
                        Ok: function () {
                            d(this).dialog("close");
                            var c = {
                                cmd: "rm",
                                current: b.fm.cwd.hash
                            };
                            b.fm.jquery > 132 ? c.targets = a : c["targets[]"] = a;
                            b.fm.ajax(c, function (a) {
                                a.tree && b.fm.reload(a)
                            }, {
                                force: !0
                            })
                        }
                    }
                }))
            };
            this.isAllowed = function () {
                if (this.fm.selected.length) for (var b = this.fm.getSelected(), a = b.length; a--;) if (b[a].rm) return !0;
                return !1
            };
            this.cm = function (b) {
                return b != "cwd"
            }
        },
        mkdir: function (g) {
            var b = this;
            this.name = "New folder";
            this.fm = g;
            this.exec = function () {
                function c() {
                    if (!b.fm.locked) {
                        var a, c = input.val();
                        b.fm.isValidName(c) ? b.fm.fileExists(c) && (a = "File or folder with the same name already exists") : a = "Invalid name";
                        if (a) return b.fm.view.error(a), b.fm.lockShortcuts(!0), el.addClass("ui-selected"), input.select().focus();
                        b.fm.ajax({
                            cmd: "mkdir",
                            current: b.fm.cwd.hash,
                            name: c
                        }, function (a) {
                            if (a.error) return el.addClass("ui-selected"), input.select().focus();
                            b.fm.reload(a)
                        }, {
                            force: !0
                        })
                    }
                }
                b.fm.unselectAll();
                var a = this.fm.uniqueName("untitled folder");
                input = d('<input type="text"/>').val(a);
                prev = this.fm.view.cwd.find(".directory:last");
                f = {
                    name: a,
                    hash: "",
                    mime: "directory",
                    read: !0,
                    write: !0,
                    date: "",
                    size: 0
                };
                el = this.fm.options.view == "list" ? d(this.fm.view.renderRow(f)).children("td").eq(1).empty().append(input).end().end() : d(this.fm.view.renderIcon(f)).children("label").empty().append(input).end();
                el.addClass("directory ui-selected");
                prev.length ? el.insertAfter(prev) : this.fm.options.view == "list" ? el.insertAfter(this.fm.view.cwd.find("tr").eq(0)) : el.prependTo(this.fm.view.cwd);
                b.fm.checkSelectedPos();
                input.select().focus().click(function (a) {
                    a.stopPropagation()
                }).bind("change blur", c).keydown(function (a) {
                    a.stopPropagation();
                    a.keyCode == 27 ? (el.remove(), b.fm.lockShortcuts()) : a.keyCode == 13 && c()
                });
                b.fm.lockShortcuts(!0)
            };
            this.isAllowed = function () {
                return this.fm.cwd.write
            };
            this.cm = function (b) {
                return b == "cwd"
            }
        },
        mkfile: function (g) {
            var b = this;
            this.name = "New text file";
            this.fm = g;
            this.exec = function () {
                function c() {
                    if (!b.fm.locked) {
                        var a, c = e.val();
                        b.fm.isValidName(c) ? b.fm.fileExists(c) && (a = "File or folder with the same name already exists") : a = "Invalid name";
                        if (a) return b.fm.view.error(a), b.fm.lockShortcuts(!0), h.addClass("ui-selected"), e.select().focus();
                        b.fm.ajax({
                            cmd: "mkfile",
                            current: b.fm.cwd.hash,
                            name: c
                        }, function (a) {
                            if (a.error) return h.addClass("ui-selected"), e.select().focus();
                            b.fm.reload(a)
                        }, {
                            force: !0
                        })
                    }
                }
                b.fm.unselectAll();
                var a = this.fm.uniqueName("untitled file", ".txt"),
                    e = d('<input type="text"/>').val(a),
                    a = {
                        name: a,
                        hash: "",
                        mime: "text/plain",
                        read: !0,
                        write: !0,
                        date: "",
                        size: 0
                    },
                    h = this.fm.options.view == "list" ? d(this.fm.view.renderRow(a)).children("td").eq(1).empty().append(e).end().end() : d(this.fm.view.renderIcon(a)).children("label").empty().append(e).end();
                h.addClass("text ui-selected").appendTo(this.fm.options.view == "list" ? b.fm.view.cwd.children("table") : b.fm.view.cwd);
                e.select().focus().bind("change blur", c).click(function (a) {
                    a.stopPropagation()
                }).keydown(function (a) {
                    a.stopPropagation();
                    a.keyCode == 27 ? (h.remove(), b.fm.lockShortcuts()) : a.keyCode == 13 && c()
                });
                b.fm.lockShortcuts(!0)
            };
            this.isAllowed = function () {
                return this.fm.cwd.write
            };
            this.cm = function (b) {
                return b == "cwd"
            }
        },
        upload: function (g) {
            var b = this;
            this.name = "Upload files";
            this.fm = g;
            this.exec = function () {
                function c(a) {
                    h.show().find("div").empty().text(a)
                }
                function a() {
                    function a() {
                        try {
                            j = h.contentWindow ? h.contentWindow.document : h.contentDocument ? h.contentDocument : h.document;
                            if (j.body == null || j.body.innerHTML == "") return --g ? setTimeout(a, 100) : (b.fm.lock(), c.remove(), b.fm.view.error("Unable to access iframe DOM after 50 tries"));
                            k = d(j.body).html();
                            l = b.fm.jquery >= 141 ? d.parseJSON(k) : /^[\],:{}\s]*$/.test(k.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, "")) ? window.JSON && window.JSON.parse ? window.JSON.parse(k) : (new Function("return " + k))() : {
                                error: "Unable to parse server response"
                            }
                        } catch (e) {
                            l = {
                                error: "Unable to parse server response"
                            }
                        }
                        b.fm.lock();
                        c.remove();
                        l.error && b.fm.view.error(l.error, l.errorData);
                        l.cwd && b.fm.reload(l);
                        l.tmb && b.fm.tmb()
                    }
                    var c = d('<iframe name="' + e + '" name="' + e + '" src="about:blank"/>'),
                        h = c[0],
                        g = 50,
                        j, k, l;
                    c.css({
                        position: "absolute",
                        top: "-1000px",
                        left: "-1000px"
                    }).appendTo("body").bind("load", function () {
                        c.unbind("load");
                        a()
                    });
                    b.fm.lock(!0);
                    i.submit()
                }
                for (var e = "el-finder-io-" + (new Date).getTime(), h = d('<div class="ui-state-error ui-corner-all"><span class="ui-icon ui-icon-alert"/><div/></div>'), g = this.fm.params.uplMaxSize ? "<p>" + this.fm.i18n("Maximum allowed files size") + ": " + this.fm.params.uplMaxSize + "</p>" : "", k = d('<p class="el-finder-add-field"><span class="ui-state-default ui-corner-all"><em class="ui-icon ui-icon-circle-plus"/></span>' + this.fm.i18n("Add field") + "</p>").click(function () {
                    d(this).before('<p><input type="file" name="upload[]"/></p>')
                }), i = '<form method="post" enctype="multipart/form-data" action="' + b.fm.options.url + '" target="' + e + '"><input type="hidden" name="cmd" value="upload" /><input type="hidden" name="current" value="' + b.fm.cwd.hash + '" />', l = d("<div/>"), m = 3; m--;) i += '<p><input type="file" name="upload[]"/></p>';
                var m = d("meta[name=csrf-token]").attr("content"),
                    n = d("meta[name=csrf-param]").attr("content");
                n != null && m != null && (i += '<input name="' + n + '" value="' + m + '" type="hidden" />');
                i = d(i + "</form>");
                l.append(i.append(h.hide()).prepend(g).append(k)).dialog({
                    dialogClass: "el-finder-dialog",
                    title: b.fm.i18n("Upload files"),
                    modal: !0,
                    resizable: !1,
                    close: function () {
                        b.fm.lockShortcuts()
                    },
                    buttons: {
                        Cancel: function () {
                            d(this).dialog("close")
                        },
                        Ok: function () {
                            if (!d(":file[value]", i).length) return c(b.fm.i18n("Select at least one file to upload"));
                            setTimeout(function () {
                                b.fm.lock();
                                d.browser.safari ? d.ajax({
                                    url: b.fm.options.url,
                                    data: {
                                        cmd: "ping"
                                    },
                                    error: a,
                                    success: a
                                }) : a()
                            });
                            d(this).dialog("close")
                        }
                    }
                });
                b.fm.lockShortcuts(!0)
            };
            this.isAllowed = function () {
                return this.fm.cwd.write
            };
            this.cm = function (b) {
                return b == "cwd"
            }
        },
        duplicate: function (d) {
            var b = this;
            this.name = "Duplicate";
            this.fm = d;
            this.exec = function () {
                this.fm.ajax({
                    cmd: "duplicate",
                    current: this.fm.cwd.hash,
                    target: this.fm.selected[0]
                }, function (c) {
                    b.fm.reload(c)
                })
            };
            this.isAllowed = function () {
                return this.fm.cwd.write && this.fm.selected.length == 1 && this.fm.getSelected()[0].read
            };
            this.cm = function (b) {
                return b == "file"
            }
        },
        edit: function (g) {
            var b = this;
            this.name = "Edit text file";
            this.fm = g;
            this.exec = function () {
                var c = this.fm.getSelected(0);
                this.fm.lockShortcuts(!0);
                this.fm.ajax({
                    cmd: "read",
                    current: this.fm.cwd.hash,
                    target: c.hash
                }, function (a) {
                    b.fm.lockShortcuts(!0);
                    var e = d("<textarea/>").val(a.content || "").keydown(function (a) {
                        a.stopPropagation();
                        if (a.keyCode == 9) if (a.preventDefault(), d.browser.msie) a = document.selection.createRange(), a.text = "\t" + a.text, this.focus();
                        else {
                            var a = this.value.substr(0, this.selectionStart),
                                b = this.value.substr(this.selectionEnd);
                            this.value = a + "\t" + b;
                            this.setSelectionRange(a.length + 1, a.length + 1)
                        }
                    });
                    d("<div/>").append(e).dialog({
                        dialogClass: "el-finder-dialog",
                        title: b.fm.i18n(b.name),
                        modal: !0,
                        width: 500,
                        close: function () {
                            b.fm.lockShortcuts()
                        },
                        buttons: {
                            Cancel: function () {
                                d(this).dialog("close")
                            },
                            Ok: function () {
                                var a = e.val();
                                d(this).dialog("close");
                                b.fm.ajax({
                                    cmd: "edit",
                                    current: b.fm.cwd.hash,
                                    target: c.hash,
                                    content: a
                                }, function (a) {
                                    if (a.target) b.fm.cdc[a.target.hash] = a.target, b.fm.view.updateFile(a.target), b.fm.selectById(a.target.hash)
                                }, {
                                    type: "POST"
                                })
                            }
                        }
                    })
                })
            };
            this.isAllowed = function () {
                if (b.fm.selected.length == 1) {
                    var c = this.fm.getSelected()[0];
                    return c.write && c.read && (c.mime.indexOf("text") == 0 || c.mime == "application/x-empty" || c.mime == "application/xml")
                }
            };
            this.cm = function (b) {
                return b == "file"
            }
        },
        archive: function (g) {
            var b = this;
            this.name = "Create archive";
            this.fm = g;
            this.exec = function (c) {
                c = {
                    cmd: "archive",
                    current: b.fm.cwd.hash,
                    type: d.inArray(c, this.fm.params.archives) != -1 ? c : this.fm.params.archives[0],
                    name: b.fm.i18n("Archive")
                };
                this.fm.jquery > 132 ? c.targets = b.fm.selected : c["targets[]"] = b.fm.selected;
                this.fm.ajax(c, function (a) {
                    b.fm.reload(a)
                })
            };
            this.isAllowed = function () {
                if (this.fm.cwd.write && this.fm.selected.length) for (var b = this.fm.getSelected(), a = b.length; a--;) if (b[a].read) return !0;
                return !1
            };
            this.cm = function (b) {
                return b != "cwd"
            };
            this.argc = function () {
                var c, a = [];
                for (c = 0; c < b.fm.params.archives.length; c++) a.push({
                    "class": "archive",
                    argc: b.fm.params.archives[c],
                    text: b.fm.view.mime2kind(b.fm.params.archives[c])
                });
                return a
            }
        },
        extract: function (g) {
            var b = this;
            this.name = "Uncompress archive";
            this.fm = g;
            this.exec = function () {
                this.fm.ajax({
                    cmd: "extract",
                    current: this.fm.cwd.hash,
                    target: this.fm.getSelected(0).hash
                }, function (c) {
                    b.fm.reload(c)
                })
            };
            this.isAllowed = function () {
                var b = this.fm.params.extract,
                    a = b && b.length;
                return this.fm.cwd.write && this.fm.selected.length == 1 && this.fm.getSelected(0).read && a && d.inArray(this.fm.getSelected(0).mime, b) != -1
            };
            this.cm = function (b) {
                return b == "file"
            }
        },
        resize: function (g) {
            var b = this;
            this.name = "Resize image";
            this.fm = g;
            this.exec = function () {
                function c() {
                    var a = parseInt(iw.val()) || 0,
                        b = parseInt(ih.val()) || 0;
                    a <= 0 || b <= 0 ? (a = h, b = g) : this == iw.get(0) ? b = parseInt(a / k) : a = parseInt(b * k);
                    iw.val(a);
                    ih.val(b)
                }
                var a = this.fm.getSelected();
                if (a[0] && a[0].write && a[0].dim) {
                    var e = a[0].dim.split("x"),
                        h = parseInt(e[0]),
                        g = parseInt(e[1]),
                        k = h / g;
                    iw = d('<input type="text" size="9" value="' + h + '" name="width"/>');
                    ih = d('<input type="text" size="9" value="' + g + '" name="height"/>');
                    f = d("<form/>").append(iw).append(" x ").append(ih).append(" px");
                    iw.add(ih).bind("change", c);
                    b.fm.lockShortcuts(!0);
                    d("<div/>").append(d("<div/>").text(b.fm.i18n("Dimensions") + ":")).append(f).dialog({
                        title: b.fm.i18n("Resize image"),
                        dialogClass: "el-finder-dialog",
                        width: 230,
                        modal: !0,
                        close: function () {
                            b.fm.lockShortcuts()
                        },
                        buttons: {
                            Cancel: function () {
                                d(this).dialog("close")
                            },
                            Ok: function () {
                                var c = parseInt(iw.val()) || 0,
                                    e = parseInt(ih.val()) || 0;
                                c > 0 && c != h && e > 0 && e != g && b.fm.ajax({
                                    cmd: "resize",
                                    current: b.fm.cwd.hash,
                                    target: a[0].hash,
                                    width: c,
                                    height: e
                                }, function (a) {
                                    b.fm.reload(a)
                                });
                                d(this).dialog("close")
                            }
                        }
                    })
                }
            };
            this.isAllowed = function () {
                return this.fm.selected.length == 1 && this.fm.cdc[this.fm.selected[0]].write && this.fm.cdc[this.fm.selected[0]].read && this.fm.cdc[this.fm.selected[0]].resize
            };
            this.cm = function (b) {
                return b == "file"
            }
        },
        icons: function (g) {
            this.name = "View as icons";
            this.fm = g;
            this.exec = function () {
                this.fm.view.win.addClass("el-finder-disabled");
                this.fm.setView("icons");
                this.fm.updateCwd();
                this.fm.view.win.removeClass("el-finder-disabled");
                d("div.image", this.fm.view.cwd).length && this.fm.tmb()
            };
            this.isAllowed = function () {
                return this.fm.options.view != "icons"
            };
            this.cm = function (b) {
                return b == "cwd"
            }
        },
        list: function (d) {
            this.name = "View as list";
            this.fm = d;
            this.exec = function () {
                this.fm.view.win.addClass("el-finder-disabled");
                this.fm.setView("list");
                this.fm.updateCwd();
                this.fm.view.win.removeClass("el-finder-disabled")
            };
            this.isAllowed = function () {
                return this.fm.options.view != "list"
            };
            this.cm = function (b) {
                return b == "cwd"
            }
        },
        help: function (g) {
            this.name = "Help";
            this.fm = g;
            this.exec = function () {
                var b, c = this.fm.i18n("helpText"),
                    a;
                b = '<div class="el-finder-logo"/><strong>' + this.fm.i18n("elFinder: Web file manager") + "</strong><br/>" + this.fm.i18n("Version") + ": " + this.fm.version + "<br/>jQuery/jQueryUI: " + d().jquery + "/" + d.ui.version + '<br clear="all"/><p><strong><a href="http://elrte.org/' + this.fm.options.lang + '/elfinder" target="_blank">' + this.fm.i18n("Donate to support project development") + '</a></strong></p><p><a href="http://elrte.org/redmine/projects/elfinder/wiki" target="_blank">' + this.fm.i18n("elFinder documentation") + "</a></p>";
                b += "<p>" + (c != "helpText" ? c : "elFinder works similar to file manager on your computer. <br /> To make actions on files/folders use icons on top panel. If icon action it is not clear for you, hold mouse cursor over it to see the hint. <br /> Manipulations with existing files/folders can be done through the context menu (mouse right-click).<br/> To copy/delete a group of files/folders, select them using Shift/Alt(Command) + mouse left-click.") + "</p>";
                b += "<p><strong>" + this.fm.i18n("elFinder support following shortcuts") + ":</strong><ul><li><kbd>Ctrl+A</kbd> - " + this.fm.i18n("Select all files") + "</li><li><kbd>Ctrl+C/Ctrl+X/Ctrl+V</kbd> - " + this.fm.i18n("Copy/Cut/Paste files") + "</li><li><kbd>Enter</kbd> - " + this.fm.i18n("Open selected file/folder") + "</li><li><kbd>Space</kbd> - " + this.fm.i18n("Open/close QuickLook window") + "</li><li><kbd>Delete/Cmd+Backspace</kbd> - " + this.fm.i18n("Remove selected files") + "</li><li><kbd>Ctrl+I</kbd> - " + this.fm.i18n("Selected files or current directory info") + "</li><li><kbd>Ctrl+N</kbd> - " + this.fm.i18n("Create new directory") + "</li><li><kbd>Ctrl+U</kbd> - " + this.fm.i18n("Open upload files form") + "</li><li><kbd>Left arrow</kbd> - " + this.fm.i18n("Select previous file") + "</li><li><kbd>Right arrow </kbd> - " + this.fm.i18n("Select next file") + "</li><li><kbd>Ctrl+Right arrow</kbd> - " + this.fm.i18n("Open selected file/folder") + "</li><li><kbd>Ctrl+Left arrow</kbd> - " + this.fm.i18n("Return into previous folder") + "</li><li><kbd>Shift+arrows</kbd> - " + this.fm.i18n("Increase/decrease files selection") + "</li></ul></p><p>" + this.fm.i18n("Contacts us if you need help integrating elFinder in you products") + ": dev@std42.ru</p>";
                c = '<div class="el-finder-help-std"/><p>' + this.fm.i18n("Javascripts/PHP programming: Dmitry (dio) Levashov, dio@std42.ru") + "</p><p>" + this.fm.i18n("Python programming, techsupport: Troex Nevelin, troex@fury.scancode.ru") + "</p><p>" + this.fm.i18n("Design: Valentin Razumnih") + "</p><p>" + this.fm.i18n("Chezh localization") + ": Roman Mat\u011bna, info@romanmatena.cz</p><p>" + this.fm.i18n("Chinese (traditional) localization") + ": Tad, tad0616@gmail.com</p><p>" + this.fm.i18n("Dutch localization") + ': Kurt Aerts, <a href="http://ilabsolutions.net/" target="_blank">http://ilabsolutions.net</a></p><p>' + this.fm.i18n("Greek localization") + ": Panagiotis Skarvelis</p><p>" + this.fm.i18n("Hungarian localization") + ": Viktor Tamas, tamas.viktor@totalstudio.hu</p><p>" + this.fm.i18n("Italian localization") + ":  Ugo Punzolo, sadraczerouno@gmail.com</p><p>" + this.fm.i18n("Latvian localization") + ":  Uldis Ploti\u0146\u0161, uldis.plotins@gmail.com</p><p>" + this.fm.i18n("Poland localization") + ":  Darek Wapi\u0144ski, darek@wapinski.us</p><p>" + this.fm.i18n("Spanish localization") + ': Alex (xand) Vavilin, xand@xand.es, <a href="http://xand.es" target="_blank">http://xand.es</a></p><p>' + this.fm.i18n("Icons") + ': <a href="http://pixelmixer.ru/" target="_blank">pixelmixer</a>,  <a href="http://www.famfamfam.com/lab/icons/silk/" target="_blank">Famfam silk icons</a>, <a href="http://www.fatcow.com/free-icons/" target="_blank">Fatcow icons</a></p><p>' + this.fm.i18n('Copyright: <a href="http://www.std42.ru" target="_blank">Studio 42 LTD</a>') + "</p><p>" + this.fm.i18n("License: BSD License") + "</p><p>" + this.fm.i18n('Web site: <a href="http://elrte.org/elfinder/" target="_blank">elrte.org/elfinder</a>') + "</p>";
                a = '<div class="el-finder-logo"/><strong><a href="http://www.eldorado-cms.ru" target="_blank">ELDORADO.CMS</a></strong><br/>' + this.fm.i18n("Simple and usefull Content Management System") + "<hr/>" + this.fm.i18n("Support project development and we will place here info about you");
                b = '<ul><li><a href="#el-finder-help-h">' + this.fm.i18n("Help") + '</a></li><li><a href="#el-finder-help-a">' + this.fm.i18n("Authors") + '</a><li><a href="#el-finder-help-sp">' + this.fm.i18n("Sponsors") + '</a></li></ul><div id="el-finder-help-h"><p>' + b + '</p></div><div id="el-finder-help-a"><p>' + c + '</p></div><div id="el-finder-help-sp"><p>' + a + "</p></div>";
                var e = d("<div/>").html(b).dialog({
                    width: 617,
                    title: this.fm.i18n("Help"),
                    dialogClass: "el-finder-dialog",
                    modal: !0,
                    close: function () {
                        e.tabs("destroy").dialog("destroy").remove()
                    },
                    buttons: {
                        Ok: function () {
                            d(this).dialog("close")
                        }
                    }
                }).tabs()
            };
            this.cm = function (b) {
                return b == "cwd"
            }
        }
    }
})(jQuery);
(function (d) {
    elFinder.prototype.quickLook = function (g) {
        function b() {
            a.media.hide().empty();
            a.win.attr("class", "el-finder-ql").css("z-index", a.fm.zIndex);
            a.title.empty();
            a.ico.attr("style", "").show();
            a.add.hide().empty();
            a._hash = ""
        }
        function c() {
            var c = a.fm.getSelected(0);
            b();
            a._hash = c.hash;
            a.title.text(c.name);
            a.win.addClass(a.fm.view.mime2class(c.mime));
            a.name.text(c.name);
            a.kind.text(a.fm.view.mime2kind(c.link ? "symlink" : c.mime));
            a.size.text(a.fm.view.formatSize(c.size));
            a.date.text(a.fm.i18n("Modified") + ": " + a.fm.view.formatDate(c.date));
            c.dim && a.add.append("<span>" + c.dim + " px</span>").show();
            c.tmb && a.ico.css("background", 'url("' + c.tmb + '") 0 0 no-repeat');
            if (c.url) {
                a.url.text(c.url).attr("href", c.url).show();
                for (var d in a.plugins) if (a.plugins[d].test && a.plugins[d].test(c.mime, a.mimes, c.name)) {
                    a.plugins[d].show(a, c);
                    return
                }
            } else a.url.hide();
            a.win.css({
                width: "420px",
                height: "auto"
            })
        }
        var a = this;
        this.fm = g;
        this._hash = "";
        this.title = d("<strong/>");
        this.ico = d("<p/>");
        this.info = d("<label/>");
        this.media = d('<div class="el-finder-ql-media"/>').hide();
        this.name = d('<span class="el-finder-ql-name"/>');
        this.kind = d('<span class="el-finder-ql-kind"/>');
        this.size = d('<span class="el-finder-ql-size"/>');
        this.date = d('<span class="el-finder-ql-date"/>');
        this.url = d('<a href="#"/>').hide().click(function (b) {
            b.preventDefault();
            window.open(d(this).attr("href"));
            a.hide()
        });
        this.add = d("<div/>");
        this.content = d('<div class="el-finder-ql-content"/>');
        this.win = d('<div class="el-finder-ql"/>').hide().append(d('<div class="el-finder-ql-drag-handle"/>').append(d('<span class="ui-icon ui-icon-circle-close"/>').click(function () {
            a.hide()
        })).append(this.title)).append(this.ico).append(this.media).append(this.content.append(this.name).append(this.kind).append(this.size).append(this.date).append(this.url).append(this.add)).appendTo("body").draggable({
            handle: ".el-finder-ql-drag-handle"
        }).resizable({
            minWidth: 420,
            minHeight: 150,
            resize: function () {
                if (a.media.children().length) {
                    var b = a.media.children(":first");
                    switch (b[0].nodeName) {
                    case "IMG":
                        var c = b.width(),
                            d = b.height(),
                            h = a.win.width(),
                            e = a.win.css("height") == "auto" ? 350 : a.win.height() - a.content.height() - a.th,
                            c = c > h || d > e ? Math.min(Math.min(h, c) / c, Math.min(e, d) / d) : Math.min(Math.max(h, c) / c, Math.max(e, d) / d);
                        b.css({
                            width: Math.round(b.width() * c),
                            height: Math.round(b.height() * c)
                        });
                        break;
                    case "IFRAME":
                    case "EMBED":
                        b.css("height", a.win.height() - a.content.height() - a.th);
                        break;
                    case "OBJECT":
                        b.children("embed").css("height", a.win.height() - a.content.height() - a.th)
                    }
                }
            }
        });
        this.th = parseInt(this.win.children(":first").css("height")) || 18;
        this.mimes = {
            "image/jpeg": "jpg",
            "image/gif": "gif",
            "image/png": "png"
        };
        for (g = 0; g < navigator.mimeTypes.length; g++) {
            var e = navigator.mimeTypes[g].type;
            if (e && e != "*") this.mimes[e] = navigator.mimeTypes[g].suffixes
        }
        if (d.browser.safari && navigator.platform.indexOf("Mac") != -1 || d.browser.msie) this.mimes["application/pdf"] = "pdf";
        else for (g = 0; g < navigator.plugins.length; g++) for (e = 0; e < navigator.plugins[g].length; e++) {
            var h = navigator.plugins[g][e].description.toLowerCase();
            if (h.substring(0, h.indexOf(" ")) == "pdf") {
                this.mimes["application/pdf"] = "pdf";
                break
            }
        }
        this.mimes["image/x-bmp"] && (this.mimes["image/x-ms-bmp"] = "bmp");
        d.browser.msie && !this.mimes["application/x-shockwave-flash"] && (this.mimes["application/x-shockwave-flash"] = "swf");
        this.show = function () {
            if (this.win.is(":hidden") && a.fm.selected.length == 1) {
                c();
                var b = a.fm.view.cwd.find('[key="' + a.fm.selected[0] + '"]'),
                    h = b.offset();
                a.fm.lockShortcuts(!0);
                this.win.css({
                    width: b.width() - 20,
                    height: b.height(),
                    left: h.left,
                    top: h.top,
                    opacity: 0
                }).show().animate({
                    width: 420,
                    height: 150,
                    opacity: 1,
                    top: Math.round(d(window).height() / 5),
                    left: d(window).width() / 2 - 210
                }, 450, function () {
                    a.win.css({
                        height: "auto"
                    });
                    a.fm.lockShortcuts()
                })
            }
        };
        this.hide = function () {
            if (this.win.is(":visible")) {
                var c, d = a.fm.view.cwd.find('[key="' + this._hash + '"]');
                d ? (c = d.offset(), this.media.hide(200), this.win.animate({
                    width: d.width() - 20,
                    height: d.height(),
                    left: c.left,
                    top: c.top,
                    opacity: 0
                }, 350, function () {
                    a.fm.lockShortcuts();
                    b();
                    a.win.hide().css("height", "auto")
                })) : (this.win.fadeOut(200), b(), a.fm.lockShortcuts())
            }
        };
        this.toggle = function () {
            this.win.is(":visible") ? this.hide() : this.show()
        };
        this.update = function () {
            this.fm.selected.length != 1 ? this.hide() : this.win.is(":visible") && this.fm.selected[0] != this._hash && c()
        };
        this.mediaHeight = function () {
            return this.win.is(":animated") || this.win.css("height") == "auto" ? 315 : this.win.height() - this.content.height() - this.th
        }
    };
    elFinder.prototype.quickLook.prototype.plugins = {
        image: new function () {
            this.test = function (d) {
                return d.match(/^image\//)
            };
            this.show = function (g, b) {
                function c(a) {
                    var b = a.width(),
                        c = a.height(),
                        d = g.win.is(":animated"),
                        i = d ? 420 : g.win.width(),
                        d = d || g.win.css("height") == "auto" ? 315 : g.win.height() - g.content.height() - g.th,
                        i = b > i || c > d ? Math.min(Math.min(i, b) / b, Math.min(d, c) / c) : Math.min(Math.max(i, b) / b, Math.max(d, c) / c);
                    g.fm.lockShortcuts(!0);
                    g.ico.hide();
                    a.css({
                        width: g.ico.width(),
                        height: g.ico.height()
                    }).show().animate({
                        width: Math.round(i * b),
                        height: Math.round(i * c)
                    }, 450, function () {
                        g.fm.lockShortcuts()
                    })
                }
                var a;
                g.mimes[b.mime] && b.hash == g._hash && d("<img/>").hide().appendTo(g.media.show()).attr("src", b.url + (d.browser.msie || d.browser.opera ? "?" + Math.random() : "")).load(function () {
                    a = d(this).unbind("load");
                    b.hash == g._hash && (g.win.is(":animated") ? setTimeout(function () {
                        c(a)
                    }, 330) : c(a))
                })
            }
        },
        text: new function () {
            this.test = function (d) {
                return d.indexOf("text") == 0 && d.indexOf("rtf") == -1 || d.match(/application\/(xml|javascript|json)/)
            };
            this.show = function (d, b) {
                b.hash == d._hash && (d.ico.hide(), d.media.append('<iframe src="' + b.url + '" style="height:' + d.mediaHeight() + 'px" />').show())
            }
        },
        swf: new function () {
            this.test = function (d, b) {
                return d == "application/x-shockwave-flash" && b[d]
            };
            this.show = function (d, b) {
                if (b.hash == d._hash) {
                    d.ico.hide();
                    var c = d.media.append('<embed pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" src="' + b.url + '" style="width:100%;height:' + d.mediaHeight() + 'px" type="application/x-shockwave-flash" />');
                    d.win.is(":animated") ? c.slideDown(450) : c.show()
                }
            }
        },
        audio: new function () {
            this.test = function (d, b) {
                return d.indexOf("audio") == 0 && b[d]
            };
            this.show = function (d, b) {
                if (b.hash == d._hash) {
                    d.ico.hide();
                    var c = d.win.is(":animated") || d.win.css("height") == "auto" ? 100 : d.win.height() - d.content.height() - d.th;
                    d.media.append('<embed src="' + b.url + '" style="width:100%;height:' + c + 'px" />').show()
                }
            }
        },
        video: new function () {
            this.test = function (d, b) {
                return d.indexOf("video") == 0 && b[d]
            };
            this.show = function (d, b) {
                b.hash == d._hash && (d.ico.hide(), d.media.append('<embed src="' + b.url + '" style="width:100%;height:' + d.mediaHeight() + 'px" />').show())
            }
        },
        pdf: new function () {
            this.test = function (d, b) {
                return d == "application/pdf" && b[d]
            };
            this.show = function (d, b) {
                b.hash == d._hash && (d.ico.hide(), d.media.append('<embed src="' + b.url + '" style="width:100%;height:' + d.mediaHeight() + 'px" />').show())
            }
        }
    }
})(jQuery);
(function (d) {
    elFinder.prototype.eventsManager = function (g) {
        function b(a, b) {
            var h, g, k;
            if (d("[key]", c.cwd).length) {
                if (c.fm.selected.length == 0) h = d("[key]:" + (a ? "first" : "last"), c.cwd), c.fm.select(h);
                else if (b) h = d(".ui-selected:" + (a ? "last" : "first"), c.cwd), g = h[a ? "next" : "prev"]("[key]"), g.length && (h = g), c.fm.select(h, !0);
                else {
                    c.pointer && (k = d('[key="' + c.pointer + '"].ui-selected', c.cwd));
                    if (!k || !k.length) k = d(".ui-selected:" + (a ? "last" : "first"), c.cwd);
                    h = k[a ? "next" : "prev"]("[key]");
                    if (h.length) if (h.hasClass("ui-selected")) if (k.hasClass("ui-selected")) if (g = k[a ? "prev" : "next"]("[key]"), !g.length || !g.hasClass("ui-selected")) c.fm.unselect(k);
                    else {
                        for (;
                        (g = a ? h.next("[key]") : h.prev("[key]")) && h.hasClass("ui-selected");) h = g;
                        c.fm.select(h)
                    } else c.fm.unselect(h);
                    else c.fm.select(h);
                    else h = k
                }
                c.pointer = h.attr("key");
                c.fm.checkSelectedPos(a)
            }
        }
        var c = this;
        this.lock = !1;
        this.fm = g;
        this.ui = g.ui;
        this.tree = g.view.tree;
        this.cwd = g.view.cwd;
        this.pointer = "";
        this.init = function () {
            var a = this,
                c = !1;
            a.lock = !1;
            this.cwd.bind("click", function (b) {
                var c = d(b.target);
                c.hasClass("ui-selected") ? a.fm.unselectAll() : (c.attr("key") || (c = c.parent("[key]")), b.ctrlKey || b.metaKey ? a.fm.toggleSelect(c) : a.fm.select(c, !0))
            }).bind(window.opera ? "click" : "contextmenu", function (b) {
                if (!window.opera || b.ctrlKey) {
                    b.preventDefault();
                    b.stopPropagation();
                    var g = d(b.target);
                    d.browser.mozilla && (c = !0);
                    g.hasClass("el-finder-cwd") ? a.fm.unselectAll() : a.fm.select(g.attr("key") ? g : g.parent("[key]"));
                    a.fm.quickLook.hide();
                    a.fm.ui.showMenu(b)
                }
            }).selectable({
                filter: "[key]",
                delay: 300,
                stop: function () {
                    a.fm.updateSelect();
                    a.fm.log("mouseup")
                }
            });
            d(document).bind("click", function (b) {
                !c && a.fm.ui.hideMenu();
                c = !1;
                d("input", a.cwd).trigger("change");
                d(b.target).is("input,textarea,select") || d("input,textarea").blur()
            });
            d("input,textarea").live("focus", function () {
                a.lock = !0
            }).live("blur", function () {
                a.lock = !1
            });
            this.tree.bind("select", function (b) {
                a.tree.find("a").removeClass("selected");
                d(b.target).addClass("selected").parents("li:has(ul)").children("ul").show().prev().children("div").addClass("expanded")
            });
            this.fm.options.places && (this.fm.view.plc.click(function (b) {
                b.preventDefault();
                var c = d(b.target).attr("key");
                if (c) c != a.fm.cwd.hash && a.ui.exec("open", b.target);
                else if (b.target.nodeName == "A" || b.target.nodeName == "DIV") b = a.fm.view.plc.find("ul"), b.children().length && (b.toggle(300), a.fm.view.plc.children("li").find("div").toggleClass("expanded"))
            }), this.fm.view.plc.droppable({
                accept: "(div,tr).directory",
                tolerance: "pointer",
                over: function () {
                    d(this).addClass("el-finder-droppable")
                },
                out: function () {
                    d(this).removeClass("el-finder-droppable")
                },
                drop: function (b, c) {
                    d(this).removeClass("el-finder-droppable");
                    var e = !1;
                    c.helper.children(".directory:not(.noaccess,.dropbox)").each(function () {
                        a.fm.addPlace(d(this).attr("key")) && (e = !0, d(this).hide())
                    });
                    e && (a.fm.view.renderPlaces(), a.updatePlaces(), a.fm.view.plc.children("li").children("div").trigger("click"));
                    c.helper.children("div:visible").length || c.helper.hide()
                }
            }));
            d(document).bind(d.browser.mozilla || d.browser.opera ? "keypress" : "keydown", function (c) {
                var d = c.ctrlKey || c.metaKey;
                if (!a.lock) switch (c.keyCode) {
                case 37:
                case 38:
                    c.stopPropagation();
                    c.preventDefault();
                    c.keyCode == 37 && d ? a.ui.execIfAllowed("back") : b(!1, !c.shiftKey);
                    break;
                case 39:
                case 40:
                    c.stopPropagation(), c.preventDefault(), d ? a.ui.execIfAllowed("open") : b(!0, !c.shiftKey)
                }
            });
            d(document).bind(d.browser.opera ? "keypress" : "keydown", function (b) {
                if (!a.lock) switch (b.keyCode) {
                case 32:
                    b.preventDefault();
                    b.stopPropagation();
                    a.fm.quickLook.toggle();
                    break;
                case 27:
                    a.fm.quickLook.hide()
                }
            });
            this.fm.options.disableShortcuts || d(document).bind("keydown", function (b) {
                var c = b.ctrlKey || b.metaKey;
                if (!a.lock) switch (b.keyCode) {
                case 8:
                    c && a.ui.isCmdAllowed("rm") && (b.preventDefault(), a.ui.exec("rm"));
                    break;
                case 13:
                    if (a.ui.isCmdAllowed("select")) return a.ui.exec("select");
                    a.ui.execIfAllowed("open");
                    break;
                case 46:
                    a.ui.execIfAllowed("rm");
                    break;
                case 65:
                    c && (b.preventDefault(), a.fm.selectAll());
                    break;
                case 67:
                    c && a.ui.execIfAllowed("copy");
                    break;
                case 73:
                    c && (b.preventDefault(), a.ui.exec("info"));
                    break;
                case 78:
                    c && (b.preventDefault(), a.ui.execIfAllowed("mkdir"));
                    break;
                case 85:
                    c && (b.preventDefault(), a.ui.execIfAllowed("upload"));
                    break;
                case 86:
                    c && a.ui.execIfAllowed("paste");
                    break;
                case 88:
                    c && a.ui.execIfAllowed("cut");
                    break;
                case 113:
                    a.ui.execIfAllowed("rename")
                }
            })
        };
        this.updateNav = function () {
            d("a", this.tree).click(function (a) {
                a.preventDefault();
                var b = d(this);
                a.target.nodeName == "DIV" && d(a.target).hasClass("collapsed") ? d(a.target).toggleClass("expanded").parent().next("ul").toggle(300) : b.attr("key") != c.fm.cwd.hash ? b.hasClass("noaccess") || b.hasClass("dropbox") ? c.fm.view.error("Access denied") : c.ui.exec("open", b.trigger("select")[0]) : (a = b.children(".collapsed"), a.length && (a.toggleClass("expanded"), b.next("ul").toggle(300)))
            });
            d("a:not(.noaccess,.readonly)", this.tree).droppable({
                tolerance: "pointer",
                accept: "div[key],tr[key]",
                over: function () {
                    d(this).addClass("el-finder-droppable")
                },
                out: function () {
                    d(this).removeClass("el-finder-droppable")
                },
                drop: function (a, b) {
                    d(this).removeClass("el-finder-droppable");
                    c.fm.drop(a, b, d(this).attr("key"))
                }
            });
            this.fm.options.places && this.updatePlaces()
        };
        this.updatePlaces = function () {
            this.fm.view.plc.children("li").find("li").draggable({
                scroll: !1,
                stop: function () {
                    c.fm.removePlace(d(this).children("a").attr("key")) && (d(this).remove(), d("li", c.fm.view.plc.children("li")).length || c.fm.view.plc.children("li").find("div").removeClass("collapsed expanded").end().children("ul").hide())
                }
            })
        };
        this.updateCwd = function () {
            d("[key]", this.cwd).bind("dblclick", function () {
                c.fm.select(d(this), !0);
                c.ui.exec(c.ui.isCmdAllowed("select") ? "select" : "open")
            }).draggable({
                delay: 3,
                addClasses: !1,
                appendTo: ".el-finder-cwd",
                revert: !0,
                drag: function (a, b) {
                    b.helper.toggleClass("el-finder-drag-copy", a.shiftKey || a.ctrlKey)
                },
                helper: function () {
                    var a = d(this),
                        b = d('<div class="el-finder-drag-helper"/>'),
                        g = 0;
                    !a.hasClass("ui-selected") && c.fm.select(a, !0);
                    c.cwd.find(".ui-selected").each(function () {
                        var a = c.fm.options.view == "icons" ? d(this).clone().removeClass("ui-selected") : d(c.fm.view.renderIcon(c.fm.cdc[d(this).attr("key")]));
                        (g++ == 0 || g % 12 == 0) && a.css("margin-left", 0);
                        b.append(a)
                    });
                    return b.css("width", (g <= 12 ? 85 + (g - 1) * 29 : 387) + "px")
                }
            }).filter(".directory").droppable({
                tolerance: "pointer",
                accept: "div[key],tr[key]",
                over: function () {
                    d(this).addClass("el-finder-droppable")
                },
                out: function () {
                    d(this).removeClass("el-finder-droppable")
                },
                drop: function (a, b) {
                    d(this).removeClass("el-finder-droppable");
                    c.fm.drop(a, b, d(this).attr("key"))
                }
            });
            d.browser.msie && d("*", this.cwd).attr("unselectable", "on").filter("[key]").bind("dragstart", function () {
                c.cwd.selectable("disable").removeClass("ui-state-disabled ui-selectable-disabled")
            }).bind("dragstop", function () {
                c.cwd.selectable("enable")
            })
        }
    }
})(jQuery);
(function (g) {
    g.color = {};
    g.color.make = function (w, j, t, V) {
        var q = {};
        q.r = w || 0;
        q.g = j || 0;
        q.b = t || 0;
        q.a = V != null ? V : 1;
        q.add = function (j, g) {
            for (var t = 0; t < j.length; ++t) q[j.charAt(t)] += g;
            return q.normalize()
        };
        q.scale = function (j, g) {
            for (var t = 0; t < j.length; ++t) q[j.charAt(t)] *= g;
            return q.normalize()
        };
        q.toString = function () {
            return q.a >= 1 ? "rgb(" + [q.r, q.g, q.b].join(",") + ")" : "rgba(" + [q.r, q.g, q.b, q.a].join(",") + ")"
        };
        q.normalize = function () {
            function j(g, q, t) {
                return q < g ? g : q > t ? t : q
            }
            q.r = j(0, parseInt(q.r), 255);
            q.g = j(0, parseInt(q.g), 255);
            q.b = j(0, parseInt(q.b), 255);
            q.a = j(0, q.a, 1);
            return q
        };
        q.clone = function () {
            return g.color.make(q.r, q.b, q.g, q.a)
        };
        return q.normalize()
    };
    g.color.extract = function (w, j) {
        var t;
        do {
            t = w.css(j).toLowerCase();
            if (t != "" && t != "transparent") break;
            w = w.parent()
        } while (!g.nodeName(w.get(0), "body"));
        t == "rgba(0, 0, 0, 0)" && (t = "transparent");
        return g.color.parse(t)
    };
    g.color.parse = function (w) {
        var j, t = g.color.make;
        if (j = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(w)) return t(parseInt(j[1], 10), parseInt(j[2], 10), parseInt(j[3], 10));
        if (j = /rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(w)) return t(parseInt(j[1], 10), parseInt(j[2], 10), parseInt(j[3], 10), parseFloat(j[4]));
        if (j = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(w)) return t(parseFloat(j[1]) * 2.55, parseFloat(j[2]) * 2.55, parseFloat(j[3]) * 2.55);
        if (j = /rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(w)) return t(parseFloat(j[1]) * 2.55, parseFloat(j[2]) * 2.55, parseFloat(j[3]) * 2.55, parseFloat(j[4]));
        if (j = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(w)) return t(parseInt(j[1], 16), parseInt(j[2], 16), parseInt(j[3], 16));
        if (j = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(w)) return t(parseInt(j[1] + j[1], 16), parseInt(j[2] + j[2], 16), parseInt(j[3] + j[3], 16));
        w = g.trim(w).toLowerCase();
        return w == "transparent" ? t(255, 255, 255, 0) : (j = L[w] || [0, 0, 0], t(j[0], j[1], j[2]))
    };
    var L = {
        aqua: [0, 255, 255],
        azure: [240, 255, 255],
        beige: [245, 245, 220],
        black: [0, 0, 0],
        blue: [0, 0, 255],
        brown: [165, 42, 42],
        cyan: [0, 255, 255],
        darkblue: [0, 0, 139],
        darkcyan: [0, 139, 139],
        darkgrey: [169, 169, 169],
        darkgreen: [0, 100, 0],
        darkkhaki: [189, 183, 107],
        darkmagenta: [139, 0, 139],
        darkolivegreen: [85, 107, 47],
        darkorange: [255, 140, 0],
        darkorchid: [153, 50, 204],
        darkred: [139, 0, 0],
        darksalmon: [233, 150, 122],
        darkviolet: [148, 0, 211],
        fuchsia: [255, 0, 255],
        gold: [255, 215, 0],
        green: [0, 128, 0],
        indigo: [75, 0, 130],
        khaki: [240, 230, 140],
        lightblue: [173, 216, 230],
        lightcyan: [224, 255, 255],
        lightgreen: [144, 238, 144],
        lightgrey: [211, 211, 211],
        lightpink: [255, 182, 193],
        lightyellow: [255, 255, 224],
        lime: [0, 255, 0],
        magenta: [255, 0, 255],
        maroon: [128, 0, 0],
        navy: [0, 0, 128],
        olive: [128, 128, 0],
        orange: [255, 165, 0],
        pink: [255, 192, 203],
        purple: [128, 0, 128],
        violet: [128, 0, 128],
        red: [255, 0, 0],
        silver: [192, 192, 192],
        white: [255, 255, 255],
        yellow: [255, 255, 0]
    }
})(jQuery);
(function (g) {
    function L(j, t, V, q) {
        function H(a, d) {
            for (var d = [y].concat(d), b = 0; b < a.length; ++b) a[b].apply(this, d)
        }
        function Z(a) {
            for (var d = [], b = 0; b < a.length; ++b) {
                var e = g.extend(!0, {}, f.series);
                a[b].data != null ? (e.data = a[b].data, delete a[b].data, g.extend(!0, e, a[b]), a[b].data = e.data) : e.data = a[b];
                d.push(e)
            }
            x = d;
            d = x.length;
            b = [];
            e = [];
            for (a = 0; a < x.length; ++a) {
                var c = x[a].color;
                c != null && (--d, typeof c == "number" ? e.push(c) : b.push(g.color.parse(x[a].color)))
            }
            for (a = 0; a < e.length; ++a) d = Math.max(d, e[a] + 1);
            b = [];
            for (a = e = 0; b.length < d;) c = f.colors.length == a ? g.color.make(100, 100, 100) : g.color.parse(f.colors[a]), c.scale("rgb", 1 + (e % 2 == 1 ? -1 : 1) * Math.ceil(e / 2) * 0.2), b.push(c), ++a, a >= f.colors.length && (a = 0, ++e);
            for (a = d = 0; a < x.length; ++a) {
                e = x[a];
                if (e.color == null) e.color = b[d].toString(), ++d;
                else if (typeof e.color == "number") e.color = b[e.color].toString();
                if (e.lines.show == null) {
                    var u, c = !0;
                    for (u in e) if (e[u] && e[u].show) {
                        c = !1;
                        break
                    }
                    if (c) e.lines.show = !0
                }
                e.xaxis = P(B, N(e, "x"));
                e.yaxis = P(F, N(e, "y"))
            }
            C()
        }
        function N(a, d) {
            var b = a[d + "axis"];
            if (typeof b == "object") b = b.n;
            typeof b != "number" && (b = 1);
            return b
        }
        function A() {
            return g.grep(B.concat(F), function (a) {
                return a
            })
        }
        function T(a) {
            var d = {},
                b, e;
            for (b = 0; b < B.length; ++b)(e = B[b]) && e.used && (d["x" + e.n] = e.c2p(a.left));
            for (b = 0; b < F.length; ++b)(e = F[b]) && e.used && (d["y" + e.n] = e.c2p(a.top));
            if (d.x1 !== void 0) d.x = d.x1;
            if (d.y1 !== void 0) d.y = d.y1;
            return d
        }
        function P(a, d) {
            a[d - 1] || (a[d - 1] = {
                n: d,
                direction: a == B ? "x" : "y",
                options: g.extend(!0, {}, a == B ? f.xaxis : f.yaxis)
            });
            return a[d - 1]
        }
        function C() {
            function a(a, b, c) {
                if (b < a.datamin && b != -e) a.datamin = b;
                if (c > a.datamax && c != e) a.datamax = c
            }
            var d = Number.POSITIVE_INFINITY,
                b = Number.NEGATIVE_INFINITY,
                e = Number.MAX_VALUE,
                c, u, p, o, k, l, z, f, h, j;
            g.each(A(), function (a, c) {
                c.datamin = d;
                c.datamax = b;
                c.used = !1
            });
            for (c = 0; c < x.length; ++c) k = x[c], k.datapoints = {
                points: []
            }, H(I.processRawData, [k, k.data, k.datapoints]);
            for (c = 0; c < x.length; ++c) {
                k = x[c];
                var Q = k.data,
                    s = k.datapoints.format;
                if (!s) {
                    s = [];
                    s.push({
                        x: !0,
                        number: !0,
                        required: !0
                    });
                    s.push({
                        y: !0,
                        number: !0,
                        required: !0
                    });
                    if (k.bars.show || k.lines.show && k.lines.fill) if (s.push({
                        y: !0,
                        number: !0,
                        required: !1,
                        defaultValue: 0
                    }), k.bars.horizontal) delete s[s.length - 1].y, s[s.length - 1].x = !0;
                    k.datapoints.format = s
                }
                if (k.datapoints.pointsize == null) {
                    k.datapoints.pointsize = s.length;
                    z = k.datapoints.pointsize;
                    l = k.datapoints.points;
                    insertSteps = k.lines.show && k.lines.steps;
                    k.xaxis.used = k.yaxis.used = !0;
                    for (u = p = 0; u < Q.length; ++u, p += z) {
                        j = Q[u];
                        var m = j == null;
                        if (!m) for (o = 0; o < z; ++o) {
                            f = j[o];
                            if (h = s[o]) if (h.number && f != null && (f = +f, isNaN(f) ? f = null : f == Infinity ? f = e : f == -Infinity && (f = -e)), f == null && (h.required && (m = !0), h.defaultValue != null)) f = h.defaultValue;
                            l[p + o] = f
                        }
                        if (m) for (o = 0; o < z; ++o) f = l[p + o], f != null && (h = s[o], h.x && a(k.xaxis, f, f), h.y && a(k.yaxis, f, f)), l[p + o] = null;
                        else if (insertSteps && p > 0 && l[p - z] != null && l[p - z] != l[p] && l[p - z + 1] != l[p + 1]) {
                            for (o = 0; o < z; ++o) l[p + z + o] = l[p + o];
                            l[p + 1] = l[p - z + 1];
                            p += z
                        }
                    }
                }
            }
            for (c = 0; c < x.length; ++c) k = x[c], H(I.processDatapoints, [k, k.datapoints]);
            for (c = 0; c < x.length; ++c) {
                k = x[c];
                l = k.datapoints.points;
                z = k.datapoints.pointsize;
                j = p = d;
                m = Q = b;
                for (u = 0; u < l.length; u += z) if (l[u] != null) for (o = 0; o < z; ++o) if (f = l[u + o], (h = s[o]) && !(f == e || f == -e)) h.x && (f < p && (p = f), f > Q && (Q = f)), h.y && (f < j && (j = f), f > m && (m = f));
                k.bars.show && (u = k.bars.align == "left" ? 0 : -k.bars.barWidth / 2, k.bars.horizontal ? (j += u, m += u + k.bars.barWidth) : (p += u, Q += u + k.bars.barWidth));
                a(k.xaxis, p, Q);
                a(k.yaxis, j, m)
            }
            g.each(A(), function (a, c) {
                if (c.datamin == d) c.datamin = null;
                if (c.datamax == b) c.datamax = null
            })
        }
        function $(a, d) {
            var b = document.createElement("canvas");
            b.className = d;
            b.width = E;
            b.height = G;
            a || g(b).css({
                position: "absolute",
                left: 0,
                top: 0
            });
            g(b).appendTo(j);
            b.getContext || (b = window.G_vmlCanvasManager.initElement(b));
            b.getContext("2d").save();
            return b
        }
        function L() {
            E = j.width();
            G = j.height();
            if (E <= 0 || G <= 0) throw "Invalid dimensions for plot, width = " + E + ", height = " + G;
        }
        function aa(a) {
            if (a.width != E) a.width = E;
            if (a.height != G) a.height = G;
            a = a.getContext("2d");
            a.restore();
            a.save()
        }
        function na(a) {
            function d(a) {
                return a
            }
            var b, e, c = a.options.transform || d,
                u = a.options.inverseTransform;
            a.direction == "x" ? (b = a.scale = O / Math.abs(c(a.max) - c(a.min)), e = Math.min(c(a.max), c(a.min))) : (b = a.scale = K / Math.abs(c(a.max) - c(a.min)), b = -b, e = Math.max(c(a.max), c(a.min)));
            a.p2c = c == d ?
            function (a) {
                return (a - e) * b
            } : function (a) {
                return (c(a) - e) * b
            };
            a.c2p = u ?
            function (a) {
                return u(e + a / b)
            } : function (a) {
                return e + a / b
            }
        }
        function oa(a) {
            function d(c, b) {
                return g('<div style="position:absolute;top:-10000px;' + b + 'font-size:smaller"><div class="' + a.direction + "Axis " + a.direction + a.n + 'Axis">' + c.join("") + "</div></div>").appendTo(j)
            }
            var b = a.options,
                e, c = a.ticks || [],
                u = [],
                p, o = b.labelWidth,
                b = b.labelHeight;
            if (a.direction == "x") {
                if (o == null && (o = Math.floor(E / (c.length > 0 ? c.length : 1))), b == null) {
                    u = [];
                    for (e = 0; e < c.length; ++e)(p = c[e].label) && u.push('<div class="tickLabel" style="float:left;width:' + o + 'px">' + p + "</div>");
                    u.length > 0 && (u.push('<div style="clear:left"></div>'), c = d(u, "width:10000px;"), b = c.height(), c.remove())
                }
            } else if (o == null || b == null) {
                for (e = 0; e < c.length; ++e)(p = c[e].label) && u.push('<div class="tickLabel">' + p + "</div>");
                u.length > 0 && (c = d(u, ""), o == null && (o = c.children().width()), b == null && (b = c.find("div.tickLabel").height()), c.remove())
            }
            o == null && (o = 0);
            b == null && (b = 0);
            a.labelWidth = o;
            a.labelHeight = b
        }
        function pa(a) {
            var d = a.labelWidth,
                b = a.labelHeight,
                e = a.options.position,
                c = a.options.tickLength,
                u = f.grid.axisMargin,
                p = f.grid.labelMargin,
                o = a.direction == "x" ? B : F,
                k = g.grep(o, function (a) {
                    return a && a.options.position == e && a.reserveSpace
                });
            g.inArray(a, k) == k.length - 1 && (u = 0);
            c == null && (c = "full");
            o = g.grep(o, function (a) {
                return a && a.reserveSpace
            });
            o = g.inArray(a, o) == 0;
            !o && c == "full" && (c = 5);
            isNaN(+c) || (p += +c);
            a.direction == "x" ? (b += p, e == "bottom" ? (n.bottom += b + u, a.box = {
                top: G - n.bottom,
                height: b
            }) : (a.box = {
                top: n.top + u,
                height: b
            }, n.top += b + u)) : (d += p, e == "left" ? (a.box = {
                left: n.left + u,
                width: d
            }, n.left += d + u) : (n.right += d + u, a.box = {
                left: E - n.right,
                width: d
            }));
            a.position = e;
            a.tickLength = c;
            a.box.padding = p;
            a.innermost = o
        }
        function ba() {
            var a, d = A();
            g.each(d, function (a, b) {
                b.show = b.options.show;
                if (b.show == null) b.show = b.used;
                b.reserveSpace = b.show || b.options.reserveSpace;
                var e = b.options,
                    d = +(e.min != null ? e.min : b.datamin),
                    f = +(e.max != null ? e.max : b.datamax),
                    l = f - d;
                if (l == 0) {
                    if (l = f == 0 ? 1 : 0.01, e.min == null && (d -= l), e.max == null || e.min != null) f += l
                } else {
                    var z = e.autoscaleMargin;
                    z != null && (e.min == null && (d -= l * z, d < 0 && b.datamin != null && b.datamin >= 0 && (d = 0)), e.max == null && (f += l * z, f > 0 && b.datamax != null && b.datamax <= 0 && (f = 0)))
                }
                b.min = d;
                b.max = f
            });
            allocatedAxes = g.grep(d, function (a) {
                return a.reserveSpace
            });
            n.left = n.right = n.top = n.bottom = 0;
            if (f.grid.show) {
                g.each(allocatedAxes, function (a, b) {
                    qa(b);
                    var e = b.options.ticks,
                        d = [];
                    e == null || typeof e == "number" && e > 0 ? d = b.tickGenerator(b) : e && (d = g.isFunction(e) ? e({
                        min: b.min,
                        max: b.max
                    }) : e);
                    var f;
                    b.ticks = [];
                    for (e = 0; e < d.length; ++e) {
                        var l = null,
                            z = d[e];
                        typeof z == "object" ? (f = +z[0], z.length > 1 && (l = z[1])) : f = +z;
                        l == null && (l = b.tickFormatter(f, b));
                        isNaN(f) || b.ticks.push({
                            v: f,
                            label: l
                        })
                    }
                    d = b.ticks;
                    if (b.options.autoscaleMargin && d.length > 0) {
                        if (b.options.min == null) b.min = Math.min(b.min, d[0].v);
                        if (b.options.max == null && d.length > 1) b.max = Math.max(b.max, d[d.length - 1].v)
                    }
                    oa(b)
                });
                for (a = allocatedAxes.length - 1; a >= 0; --a) pa(allocatedAxes[a]);
                var b = f.grid.minBorderMargin;
                if (b == null) for (a = b = 0; a < x.length; ++a) b = Math.max(b, x[a].points.radius + x[a].points.lineWidth / 2);
                for (var e in n) n[e] += f.grid.borderWidth, n[e] = Math.max(b, n[e])
            }
            O = E - n.left - n.right;
            K = G - n.bottom - n.top;
            g.each(d, function (a, b) {
                na(b)
            });
            f.grid.show && (g.each(allocatedAxes, function (a, b) {
                b.direction == "x" ? (b.box.left = n.left, b.box.width = O) : (b.box.top = n.top, b.box.height = K)
            }), ra());
            sa()
        }
        function qa(a) {
            var d = a.options,
                b;
            b = typeof d.ticks == "number" && d.ticks > 0 ? d.ticks : 0.3 * Math.sqrt(a.direction == "x" ? E : G);
            b = (a.max - a.min) / b;
            var e, c, f, p;
            if (d.mode == "time") {
                var o = {
                    second: 1E3,
                    minute: 6E4,
                    hour: 36E5,
                    day: 864E5,
                    month: 2592E6,
                    year: 525949.2 * 6E4
                };
                p = [
                    [1, "second"],
                    [2, "second"],
                    [5, "second"],
                    [10, "second"],
                    [30, "second"],
                    [1, "minute"],
                    [2, "minute"],
                    [5, "minute"],
                    [10, "minute"],
                    [30, "minute"],
                    [1, "hour"],
                    [2, "hour"],
                    [4, "hour"],
                    [8, "hour"],
                    [12, "hour"],
                    [1, "day"],
                    [2, "day"],
                    [3, "day"],
                    [0.25, "month"],
                    [0.5, "month"],
                    [1, "month"],
                    [2, "month"],
                    [3, "month"],
                    [6, "month"],
                    [1, "year"]
                ];
                e = 0;
                d.minTickSize != null && (e = typeof d.tickSize == "number" ? d.tickSize : d.minTickSize[0] * o[d.minTickSize[1]]);
                for (c = 0; c < p.length - 1; ++c) if (b < (p[c][0] * o[p[c][1]] + p[c + 1][0] * o[p[c + 1][1]]) / 2 && p[c][0] * o[p[c][1]] >= e) break;
                e = p[c][0];
                f = p[c][1];
                f == "year" && (c = Math.pow(10, Math.floor(Math.log(b / o.year) / Math.LN10)), p = b / o.year / c, e = p < 1.5 ? 1 : p < 3 ? 2 : p < 7.5 ? 5 : 10, e *= c);
                a.tickSize = d.tickSize || [e, f];
                c = function (a) {
                    var b = [],
                        e = a.tickSize[0],
                        c = a.tickSize[1],
                        d = new Date(a.min),
                        f = e * o[c];
                    c == "second" && d.setUTCSeconds(w(d.getUTCSeconds(), e));
                    c == "minute" && d.setUTCMinutes(w(d.getUTCMinutes(), e));
                    c == "hour" && d.setUTCHours(w(d.getUTCHours(), e));
                    c == "month" && d.setUTCMonth(w(d.getUTCMonth(), e));
                    c == "year" && d.setUTCFullYear(w(d.getUTCFullYear(), e));
                    d.setUTCMilliseconds(0);
                    f >= o.minute && d.setUTCSeconds(0);
                    f >= o.hour && d.setUTCMinutes(0);
                    f >= o.day && d.setUTCHours(0);
                    f >= o.day * 4 && d.setUTCDate(1);
                    f >= o.year && d.setUTCMonth(0);
                    var p = 0,
                        k = Number.NaN,
                        l;
                    do
                    if (l = k, k = d.getTime(), b.push(k), c == "month") if (e < 1) {
                        d.setUTCDate(1);
                        var u = d.getTime();
                        d.setUTCMonth(d.getUTCMonth() + 1);
                        var h = d.getTime();
                        d.setTime(k + p * o.hour + (h - u) * e);
                        p = d.getUTCHours();
                        d.setUTCHours(0)
                    } else d.setUTCMonth(d.getUTCMonth() + e);
                    else c == "year" ? d.setUTCFullYear(d.getUTCFullYear() + e) : d.setTime(k + f);
                    while (k < a.max && k != l);
                    return b
                };
                e = function (a, b) {
                    var e = new Date(a);
                    if (d.timeformat != null) return g.plot.formatDate(e, d.timeformat, d.monthNames);
                    var c = b.tickSize[0] * o[b.tickSize[1]],
                        f = b.max - b.min,
                        k = d.twelveHourClock ? " %p" : "";
                    fmt = c < o.minute ? "%h:%M:%S" + k : c < o.day ? f < 2 * o.day ? "%h:%M" + k : "%b %d %h:%M" + k : c < o.month ? "%b %d" : c < o.year ? f < o.year ? "%b" : "%b %y" : "%y";
                    return g.plot.formatDate(e, fmt, d.monthNames)
                }
            } else {
                f = d.tickDecimals;
                var k = -Math.floor(Math.log(b) / Math.LN10);
                f != null && k > f && (k = f);
                c = Math.pow(10, -k);
                p = b / c;
                if (p < 1.5) e = 1;
                else if (p < 3) {
                    if (e = 2, p > 2.25 && (f == null || k + 1 <= f)) e = 2.5, ++k
                } else e = p < 7.5 ? 5 : 10;
                e *= c;
                if (d.minTickSize != null && e < d.minTickSize) e = d.minTickSize;
                a.tickDecimals = Math.max(0, f != null ? f : k);
                a.tickSize = d.tickSize || e;
                c = function (a) {
                    var b = [],
                        e = w(a.min, a.tickSize),
                        c = 0,
                        d = Number.NaN,
                        f;
                    do f = d, d = e + c * a.tickSize, b.push(d), ++c;
                    while (d < a.max && d != f);
                    return b
                };
                e = function (a, b) {
                    return a.toFixed(b.tickDecimals)
                }
            }
            if (d.alignTicksWithAxis != null) {
                var l = (a.direction == "x" ? B : F)[d.alignTicksWithAxis - 1];
                if (l && l.used && l != a) {
                    c = c(a);
                    if (c.length > 0) {
                        if (d.min == null) a.min = Math.min(a.min, c[0]);
                        if (d.max == null && c.length > 1) a.max = Math.max(a.max, c[c.length - 1])
                    }
                    c = function (a) {
                        var b = [],
                            e, c;
                        for (c = 0; c < l.ticks.length; ++c) e = (l.ticks[c].v - l.min) / (l.max - l.min), e = a.min + e * (a.max - a.min), b.push(e);
                        return b
                    };
                    if (a.mode != "time" && d.tickDecimals == null && (b = Math.max(0, -Math.floor(Math.log(b) / Math.LN10) + 1), p = c(a), !(p.length > 1 && /\..*0$/.test((p[1] - p[0]).toFixed(b))))) a.tickDecimals = b
                }
            }
            a.tickGenerator = c;
            a.tickFormatter = g.isFunction(d.tickFormatter) ?
            function (a, b) {
                return "" + d.tickFormatter(a, b)
            } : e
        }
        function ca() {
            h.clearRect(0, 0, E, G);
            var a = f.grid;
            if (a.show && a.backgroundColor) h.save(), h.translate(n.left, n.top), h.fillStyle = da(f.grid.backgroundColor, K, 0, "rgba(255, 255, 255, 0)"), h.fillRect(0, 0, O, K), h.restore();
            a.show && !a.aboveData && ea();
            for (var d = 0; d < x.length; ++d) {
                H(I.drawSeries, [h, x[d]]);
                var b = x[d];
                b.lines.show && ta(b);
                b.bars.show && ua(b);
                b.points.show && va(b)
            }
            H(I.draw, [h]);
            a.show && a.aboveData && ea()
        }
        function fa(a, d) {
            var b, e, c, f, p = A();
            for (i = 0; i < p.length; ++i) if (b = p[i], b.direction == d && (f = d + b.n + "axis", !a[f] && b.n == 1 && (f = d + "axis"), a[f])) {
                e = a[f].from;
                c = a[f].to;
                break
            }
            a[f] || (b = d == "x" ? B[0] : F[0], e = a[d + "1"], c = a[d + "2"]);
            e != null && c != null && e > c && (f = e, e = c, c = f);
            return {
                from: e,
                to: c,
                axis: b
            }
        }
        function ea() {
            var a;
            h.save();
            h.translate(n.left, n.top);
            var d = f.grid.markings;
            if (d) {
                if (g.isFunction(d)) {
                    var b = y.getAxes();
                    b.xmin = b.xaxis.min;
                    b.xmax = b.xaxis.max;
                    b.ymin = b.yaxis.min;
                    b.ymax = b.yaxis.max;
                    d = d(b)
                }
                for (a = 0; a < d.length; ++a) {
                    var b = d[a],
                        e = fa(b, "x"),
                        c = fa(b, "y");
                    if (e.from == null) e.from = e.axis.min;
                    if (e.to == null) e.to = e.axis.max;
                    if (c.from == null) c.from = c.axis.min;
                    if (c.to == null) c.to = c.axis.max;
                    if (!(e.to < e.axis.min || e.from > e.axis.max || c.to < c.axis.min || c.from > c.axis.max)) if (e.from = Math.max(e.from, e.axis.min), e.to = Math.min(e.to, e.axis.max), c.from = Math.max(c.from, c.axis.min), c.to = Math.min(c.to, c.axis.max), !(e.from == e.to && c.from == c.to)) e.from = e.axis.p2c(e.from), e.to = e.axis.p2c(e.to), c.from = c.axis.p2c(c.from), c.to = c.axis.p2c(c.to), e.from == e.to || c.from == c.to ? (h.beginPath(), h.strokeStyle = b.color || f.grid.markingsColor, h.lineWidth = b.lineWidth || f.grid.markingsLineWidth, h.moveTo(e.from, c.from), h.lineTo(e.to, c.to), h.stroke()) : (h.fillStyle = b.color || f.grid.markingsColor, h.fillRect(e.from, c.to, e.to - e.from, c.from - c.to))
                }
            }
            b = A();
            d = f.grid.borderWidth;
            for (e = 0; e < b.length; ++e) {
                c = b[e];
                a = c.box;
                var u = c.tickLength,
                    p, o, k, l;
                if (c.show && c.ticks.length != 0) {
                    h.strokeStyle = c.options.tickColor || g.color.parse(c.options.color).scale("a", 0.22).toString();
                    h.lineWidth = 1;
                    c.direction == "x" ? (p = 0, o = u == "full" ? c.position == "top" ? 0 : K : a.top - n.top + (c.position == "top" ? a.height : 0)) : (o = 0, p = u == "full" ? c.position == "left" ? 0 : O : a.left - n.left + (c.position == "left" ? a.width : 0));
                    c.innermost || (h.beginPath(), k = l = 0, c.direction == "x" ? k = O : l = K, h.lineWidth == 1 && (p = Math.floor(p) + 0.5, o = Math.floor(o) + 0.5), h.moveTo(p, o), h.lineTo(p + k, o + l), h.stroke());
                    h.beginPath();
                    for (a = 0; a < c.ticks.length; ++a) {
                        var z = c.ticks[a].v;
                        k = l = 0;
                        z < c.min || z > c.max || u == "full" && d > 0 && (z == c.min || z == c.max) || (c.direction == "x" ? (p = c.p2c(z), l = u == "full" ? -K : u, c.position == "top" && (l = -l)) : (o = c.p2c(z), k = u == "full" ? -O : u, c.position == "left" && (k = -k)), h.lineWidth == 1 && (c.direction == "x" ? p = Math.floor(p) + 0.5 : o = Math.floor(o) + 0.5), h.moveTo(p, o), h.lineTo(p + k, o + l))
                    }
                    h.stroke()
                }
            }
            if (d) h.lineWidth = d, h.strokeStyle = f.grid.borderColor, h.strokeRect(-d / 2, -d / 2, O + d, K + d);
            h.restore()
        }
        function ra() {
            j.find(".tickLabels").remove();
            for (var a = ['<div class="tickLabels" style="font-size:smaller">'], d = A(), b = 0; b < d.length; ++b) {
                var e = d[b],
                    c = e.box;
                if (e.show) {
                    a.push('<div class="' + e.direction + "Axis " + e.direction + e.n + 'Axis" style="color:' + e.options.color + '">');
                    for (var f = 0; f < e.ticks.length; ++f) {
                        var p = e.ticks[f];
                        if (p.label && !(p.v < e.min || p.v > e.max)) {
                            var o = {},
                                k;
                            e.direction == "x" ? (k = "center", o.left = Math.round(n.left + e.p2c(p.v) - e.labelWidth / 2), e.position == "bottom" ? o.top = c.top + c.padding : o.bottom = G - (c.top + c.height - c.padding)) : (o.top = Math.round(n.top + e.p2c(p.v) - e.labelHeight / 2), e.position == "left" ? (o.right = E - (c.left + c.width - c.padding), k = "right") : (o.left = c.left + c.padding, k = "left"));
                            o.width = e.labelWidth;
                            k = ["position:absolute", "text-align:" + k];
                            for (var l in o) k.push(l + ":" + o[l] + "px");
                            a.push('<div class="tickLabel" style="' + k.join(";") + '">' + p.label + "</div>")
                        }
                    }
                    a.push("</div>")
                }
            }
            a.push("</div>");
            j.append(a.join(""))
        }
        function ta(a) {
            function d(a, b, e, c, d) {
                var f = a.points,
                    a = a.pointsize,
                    j = null,
                    u = null;
                h.beginPath();
                for (var g = a; g < f.length; g += a) {
                    var s = f[g - a],
                        m = f[g - a + 1],
                        r = f[g],
                        v = f[g + 1];
                    if (!(s == null || r == null)) {
                        if (m <= v && m < d.min) {
                            if (v < d.min) continue;
                            s = (d.min - m) / (v - m) * (r - s) + s;
                            m = d.min
                        } else if (v <= m && v < d.min) {
                            if (m < d.min) continue;
                            r = (d.min - m) / (v - m) * (r - s) + s;
                            v = d.min
                        }
                        if (m >= v && m > d.max) {
                            if (v > d.max) continue;
                            s = (d.max - m) / (v - m) * (r - s) + s;
                            m = d.max
                        } else if (v >= m && v > d.max) {
                            if (m > d.max) continue;
                            r = (d.max - m) / (v - m) * (r - s) + s;
                            v = d.max
                        }
                        if (s <= r && s < c.min) {
                            if (r < c.min) continue;
                            m = (c.min - s) / (r - s) * (v - m) + m;
                            s = c.min
                        } else if (r <= s && r < c.min) {
                            if (s < c.min) continue;
                            v = (c.min - s) / (r - s) * (v - m) + m;
                            r = c.min
                        }
                        if (s >= r && s > c.max) {
                            if (r > c.max) continue;
                            m = (c.max - s) / (r - s) * (v - m) + m;
                            s = c.max
                        } else if (r >= s && r > c.max) {
                            if (s > c.max) continue;
                            v = (c.max - s) / (r - s) * (v - m) + m;
                            r = c.max
                        }(s != j || m != u) && h.moveTo(c.p2c(s) + b, d.p2c(m) + e);
                        j = r;
                        u = v;
                        h.lineTo(c.p2c(r) + b, d.p2c(v) + e)
                    }
                }
                h.stroke()
            }

            function b(a, b, c) {
                for (var d = a.points, a = a.pointsize, e = Math.min(Math.max(0, c.min), c.max), f = 0, j = !1, u = 1, g = 0, s = 0;;) {
                    if (a > 0 && f > d.length + a) break;
                    f += a;
                    var m = d[f - a],
                        r = d[f - a + u],
                        v = d[f],
                        n = d[f + u];
                    if (j) {
                        if (a > 0 && m != null && v == null) {
                            s = f;
                            a = -a;
                            u = 2;
                            continue
                        }
                        if (a < 0 && f == g + a) {
                            h.fill();
                            j = !1;
                            a = -a;
                            u = 1;
                            f = g = s + a;
                            continue
                        }
                    }
                    if (!(m == null || v == null)) {
                        if (m <= v && m < b.min) {
                            if (v < b.min) continue;
                            r = (b.min - m) / (v - m) * (n - r) + r;
                            m = b.min
                        } else if (v <= m && v < b.min) {
                            if (m < b.min) continue;
                            n = (b.min - m) / (v - m) * (n - r) + r;
                            v = b.min
                        }
                        if (m >= v && m > b.max) {
                            if (v > b.max) continue;
                            r = (b.max - m) / (v - m) * (n - r) + r;
                            m = b.max
                        } else if (v >= m && v > b.max) {
                            if (m > b.max) continue;
                            n = (b.max - m) / (v - m) * (n - r) + r;
                            v = b.max
                        }
                        j || (h.beginPath(), h.moveTo(b.p2c(m), c.p2c(e)), j = !0);
                        if (r >= c.max && n >= c.max) h.lineTo(b.p2c(m), c.p2c(c.max)), h.lineTo(b.p2c(v), c.p2c(c.max));
                        else if (r <= c.min && n <= c.min) h.lineTo(b.p2c(m), c.p2c(c.min)), h.lineTo(b.p2c(v), c.p2c(c.min));
                        else {
                            var q = m,
                                t = v;
                            if (r <= n && r < c.min && n >= c.min) m = (c.min - r) / (n - r) * (v - m) + m, r = c.min;
                            else if (n <= r && n < c.min && r >= c.min) v = (c.min - r) / (n - r) * (v - m) + m, n = c.min;
                            if (r >= n && r > c.max && n <= c.max) m = (c.max - r) / (n - r) * (v - m) + m, r = c.max;
                            else if (n >= r && n > c.max && r <= c.max) v = (c.max - r) / (n - r) * (v - m) + m, n = c.max;
                            m != q && h.lineTo(b.p2c(q), c.p2c(r));
                            h.lineTo(b.p2c(m), c.p2c(r));
                            h.lineTo(b.p2c(v), c.p2c(n));
                            v != t && (h.lineTo(b.p2c(v), c.p2c(n)), h.lineTo(b.p2c(t), c.p2c(n)))
                        }
                    }
                }
            }
            h.save();
            h.translate(n.left, n.top);
            h.lineJoin = "round";
            var e = a.lines.lineWidth,
                c = a.shadowSize;
            if (e > 0 && c > 0) {
                h.lineWidth = c;
                h.strokeStyle = "rgba(0,0,0,0.1)";
                var f = Math.PI / 18;
                d(a.datapoints, Math.sin(f) * (e / 2 + c / 2), Math.cos(f) * (e / 2 + c / 2), a.xaxis, a.yaxis);
                h.lineWidth = c / 2;
                d(a.datapoints, Math.sin(f) * (e / 2 + c / 4), Math.cos(f) * (e / 2 + c / 4), a.xaxis, a.yaxis)
            }
            h.lineWidth = e;
            h.strokeStyle = a.color;
            if (c = X(a.lines, a.color, 0, K)) h.fillStyle = c, b(a.datapoints, a.xaxis, a.yaxis);
            e > 0 && d(a.datapoints, 0, 0, a.xaxis, a.yaxis);
            h.restore()
        }
        function va(a) {
            function d(a, b, c, d, e, f, j, u) {
                for (var g = a.points, a = a.pointsize, n = 0; n < g.length; n += a) {
                    var m = g[n],
                        r = g[n + 1];
                    if (!(m == null || m < f.min || m > f.max || r < j.min || r > j.max)) {
                        h.beginPath();
                        m = f.p2c(m);
                        r = j.p2c(r) + d;
                        u == "circle" ? h.arc(m, r, b, 0, e ? Math.PI : Math.PI * 2, !1) : u(h, m, r, b, e);
                        h.closePath();
                        if (c) h.fillStyle = c, h.fill();
                        h.stroke()
                    }
                }
            }
            h.save();
            h.translate(n.left, n.top);
            var b = a.points.lineWidth,
                e = a.shadowSize,
                c = a.points.radius,
                f = a.points.symbol;
            if (b > 0 && e > 0) e /= 2, h.lineWidth = e, h.strokeStyle = "rgba(0,0,0,0.1)", d(a.datapoints, c, null, e + e / 2, !0, a.xaxis, a.yaxis, f), h.strokeStyle = "rgba(0,0,0,0.2)", d(a.datapoints, c, null, e / 2, !0, a.xaxis, a.yaxis, f);
            h.lineWidth = b;
            h.strokeStyle = a.color;
            d(a.datapoints, c, X(a.points, a.color), 0, !1, a.xaxis, a.yaxis, f);
            h.restore()
        }
        function ga(a, d, b, e, c, f, j, h, k, l, g, n) {
            var q, t, x, s;
            g ? (s = t = x = !0, q = !1, g = b, b = d + e, c = d + c, a < g && (d = a, a = g, g = d, q = !0, t = !1)) : (q = t = x = !0, s = !1, g = a + e, a += c, c = b, b = d, b < c && (d = b, b = c, c = d, s = !0, x = !1));
            if (!(a < h.min || g > h.max || b < k.min || c > k.max)) {
                if (g < h.min) g = h.min, q = !1;
                if (a > h.max) a = h.max, t = !1;
                if (c < k.min) c = k.min, s = !1;
                if (b > k.max) b = k.max, x = !1;
                g = h.p2c(g);
                c = k.p2c(c);
                a = h.p2c(a);
                b = k.p2c(b);
                if (j) l.beginPath(), l.moveTo(g, c), l.lineTo(g, b), l.lineTo(a, b), l.lineTo(a, c), l.fillStyle = j(c, b), l.fill();
                if (n > 0 && (q || t || x || s)) l.beginPath(), l.moveTo(g, c + f), q ? l.lineTo(g, b + f) : l.moveTo(g, b + f), x ? l.lineTo(a, b + f) : l.moveTo(a, b + f), t ? l.lineTo(a, c + f) : l.moveTo(a, c + f), s ? l.lineTo(g, c + f) : l.moveTo(g, c + f), l.stroke()
            }
        }
        function ua(a) {
            h.save();
            h.translate(n.left, n.top);
            h.lineWidth = a.bars.lineWidth;
            h.strokeStyle = a.color;
            var d = a.bars.align == "left" ? 0 : -a.bars.barWidth / 2;
            (function (b, d, c, f, g, j, k) {
                for (var l = b.points, b = b.pointsize, n = 0; n < l.length; n += b) l[n] != null && ga(l[n], l[n + 1], l[n + 2], d, c, f, g, j, k, h, a.bars.horizontal, a.bars.lineWidth)
            })(a.datapoints, d, d + a.bars.barWidth, 0, a.bars.fill ?
            function (b, d) {
                return X(a.bars, a.color, b, d)
            } : null, a.xaxis, a.yaxis);
            h.restore()
        }
        function X(a, d, b, e) {
            var c = a.fill;
            if (!c) return null;
            if (a.fillColor) return da(a.fillColor, b, e, d);
            a = g.color.parse(d);
            a.a = typeof c == "number" ? c : 0.4;
            a.normalize();
            return a.toString()
        }
        function sa() {
            j.find(".legend").remove();
            if (f.legend.show) {
                for (var a = [], d = !1, b = f.legend.labelFormatter, e, c, h = 0; h < x.length; ++h) if (e = x[h], c = e.label) h % f.legend.noColumns == 0 && (d && a.push("</tr>"), a.push("<tr>"), d = !0), b && (c = b(c, e)), a.push('<td class="legendColorBox"><div style="border:1px solid ' + f.legend.labelBoxBorderColor + ';padding:1px"><div style="width:4px;height:0;border:5px solid ' + e.color + ';overflow:hidden"></div></div></td><td class="legendLabel">' + c + "</td>");
                d && a.push("</tr>");
                if (a.length != 0) if (d = '<table style="font-size:smaller;color:' + f.grid.color + '">' + a.join("") + "</table>", f.legend.container != null) g(f.legend.container).html(d);
                else if (a = "", b = f.legend.position, e = f.legend.margin, e[0] == null && (e = [e, e]), b.charAt(0) == "n" ? a += "top:" + (e[1] + n.top) + "px;" : b.charAt(0) == "s" && (a += "bottom:" + (e[1] + n.bottom) + "px;"), b.charAt(1) == "e" ? a += "right:" + (e[0] + n.right) + "px;" : b.charAt(1) == "w" && (a += "left:" + (e[0] + n.left) + "px;"), d = g('<div class="legend">' + d.replace('style="', 'style="position:absolute;' + a + ";") + "</div>").appendTo(j), f.legend.backgroundOpacity != 0) {
                    b = f.legend.backgroundColor;
                    if (b == null) b = (b = f.grid.backgroundColor) && typeof b == "string" ? g.color.parse(b) : g.color.extract(d, "background-color"), b.a = 1, b = b.toString();
                    e = d.children();
                    g('<div style="position:absolute;width:' + e.width() + "px;height:" + e.height() + "px;" + a + "background-color:" + b + ';"> </div>').prependTo(d).css("opacity", f.legend.backgroundOpacity)
                }
            }
        }
        function ha(a) {
            f.grid.hoverable && Y("plothover", a, function (a) {
                return a.hoverable != !1
            })
        }
        function ia(a) {
            f.grid.hoverable && Y("plothover", a, function () {
                return !1
            })
        }
        function ja(a) {
            Y("plotclick", a, function (a) {
                return a.clickable != !1
            })
        }
        function Y(a, d, b) {
            var e = J.offset(),
                c = d.pageX - e.left - n.left,
                h = d.pageY - e.top - n.top,
                g = T({
                    left: c,
                    top: h
                });
            g.pageX = d.pageX;
            g.pageY = d.pageY;
            var d = f.grid.mouseActiveRadius,
                o = d * d + 1,
                k = null,
                l, q;
            for (l = x.length - 1; l >= 0; --l) if (b(x[l])) {
                var t = x[l],
                    y = t.xaxis,
                    w = t.yaxis,
                    C = t.datapoints.points,
                    s = t.datapoints.pointsize,
                    m = y.c2p(c),
                    r = w.c2p(h),
                    v = d / y.scale,
                    D = d / w.scale;
                if (y.options.inverseTransform) v = Number.MAX_VALUE;
                if (w.options.inverseTransform) D = Number.MAX_VALUE;
                if (t.lines.show || t.points.show) for (q = 0; q < C.length; q += s) {
                    var B = C[q],
                        A = C[q + 1];
                    if (B != null && !(B - m > v || B - m < -v || A - r > D || A - r < -D)) B = Math.abs(y.p2c(B) - c), A = Math.abs(w.p2c(A) - h), A = B * B + A * A, A < o && (o = A, k = [l, q / s])
                }
                if (t.bars.show && !k) {
                    y = t.bars.align == "left" ? 0 : -t.bars.barWidth / 2;
                    t = y + t.bars.barWidth;
                    for (q = 0; q < C.length; q += s) if (B = C[q], A = C[q + 1], w = C[q + 2], B != null && (x[l].bars.horizontal ? m <= Math.max(w, B) && m >= Math.min(w, B) && r >= A + y && r <= A + t : m >= B + y && m <= B + t && r >= Math.min(w, A) && r <= Math.max(w, A))) k = [l, q / s]
                }
            }
            k ? (l = k[0], q = k[1], s = x[l].datapoints.pointsize, b = {
                datapoint: x[l].datapoints.points.slice(q * s, (q + 1) * s),
                dataIndex: q,
                series: x[l],
                seriesIndex: l
            }) : b = null;
            if (b) b.pageX = parseInt(b.series.xaxis.p2c(b.datapoint[0]) + e.left + n.left), b.pageY = parseInt(b.series.yaxis.p2c(b.datapoint[1]) + e.top + n.top);
            if (f.grid.autoHighlight) {
                for (e = 0; e < M.length; ++e) c = M[e], c.auto == a && (!b || !(c.series == b.series && c.point[0] == b.datapoint[0] && c.point[1] == b.datapoint[1])) && ka(c.series, c.point);
                b && la(b.series, b.datapoint, a)
            }
            j.trigger(a, [g, b])
        }
        function W() {
            U || (U = setTimeout(wa, 30))
        }
        function wa() {
            U = null;
            D.save();
            D.clearRect(0, 0, E, G);
            D.translate(n.left, n.top);
            var a, d;
            for (a = 0; a < M.length; ++a) if (d = M[a], d.series.bars.show) xa(d.series, d.point);
            else {
                var b = d.series,
                    e = d.point;
                d = e[0];
                var e = e[1],
                    c = b.xaxis,
                    f = b.yaxis;
                if (!(d < c.min || d > c.max || e < f.min || e > f.max)) {
                    var h = b.points.radius + b.points.lineWidth / 2;
                    D.lineWidth = h;
                    D.strokeStyle = g.color.parse(b.color).scale("a", 0.5).toString();
                    h *= 1.5;
                    d = c.p2c(d);
                    e = f.p2c(e);
                    D.beginPath();
                    b.points.symbol == "circle" ? D.arc(d, e, h, 0, 2 * Math.PI, !1) : b.points.symbol(D, d, e, h, !1);
                    D.closePath();
                    D.stroke()
                }
            }
            D.restore();
            H(I.drawOverlay, [D])
        }
        function la(a, d, b) {
            typeof a == "number" && (a = x[a]);
            if (typeof d == "number") var e = a.datapoints.pointsize,
                d = a.datapoints.points.slice(e * d, e * (d + 1));
            e = ma(a, d);
            if (e == -1) M.push({
                series: a,
                point: d,
                auto: b
            }), W();
            else if (!b) M[e].auto = !1
        }
        function ka(a, d) {
            a == null && d == null && (M = [], W());
            typeof a == "number" && (a = x[a]);
            typeof d == "number" && (d = a.data[d]);
            var b = ma(a, d);
            b != -1 && (M.splice(b, 1), W())
        }
        function ma(a, d) {
            for (var b = 0; b < M.length; ++b) {
                var e = M[b];
                if (e.series == a && e.point[0] == d[0] && e.point[1] == d[1]) return b
            }
            return -1
        }
        function xa(a, d) {
            D.lineWidth = a.bars.lineWidth;
            D.strokeStyle = g.color.parse(a.color).scale("a", 0.5).toString();
            var b = g.color.parse(a.color).scale("a", 0.5).toString(),
                e = a.bars.align == "left" ? 0 : -a.bars.barWidth / 2;
            ga(d[0], d[1], d[2] || 0, e, e + a.bars.barWidth, 0, function () {
                return b
            }, a.xaxis, a.yaxis, D, a.bars.horizontal, a.bars.lineWidth)
        }
        function da(a, d, b, e) {
            if (typeof a == "string") return a;
            else {
                for (var d = h.createLinearGradient(0, b, 0, d), b = 0, c = a.colors.length; b < c; ++b) {
                    var f = a.colors[b];
                    if (typeof f != "string") {
                        var j = g.color.parse(e);
                        f.brightness != null && (j = j.scale("rgb", f.brightness));
                        f.opacity != null && (j.a *= f.opacity);
                        f = j.toString()
                    }
                    d.addColorStop(b / (c - 1), f)
                }
                return d
            }
        }
        var x = [],
            f = {
                colors: ["#edc240", "#afd8f8", "#cb4b4b", "#4da74d", "#9440ed"],
                legend: {
                    show: !0,
                    noColumns: 1,
                    labelFormatter: null,
                    labelBoxBorderColor: "#ccc",
                    container: null,
                    position: "ne",
                    margin: 5,
                    backgroundColor: null,
                    backgroundOpacity: 0.85
                },
                xaxis: {
                    show: null,
                    position: "bottom",
                    mode: null,
                    color: null,
                    tickColor: null,
                    transform: null,
                    inverseTransform: null,
                    min: null,
                    max: null,
                    autoscaleMargin: null,
                    ticks: null,
                    tickFormatter: null,
                    labelWidth: null,
                    labelHeight: null,
                    reserveSpace: null,
                    tickLength: null,
                    alignTicksWithAxis: null,
                    tickDecimals: null,
                    tickSize: null,
                    minTickSize: null,
                    monthNames: null,
                    timeformat: null,
                    twelveHourClock: !1
                },
                yaxis: {
                    autoscaleMargin: 0.02,
                    position: "left"
                },
                xaxes: [],
                yaxes: [],
                series: {
                    points: {
                        show: !1,
                        radius: 3,
                        lineWidth: 2,
                        fill: !0,
                        fillColor: "#ffffff",
                        symbol: "circle"
                    },
                    lines: {
                        lineWidth: 2,
                        fill: !1,
                        fillColor: null,
                        steps: !1
                    },
                    bars: {
                        show: !1,
                        lineWidth: 2,
                        barWidth: 1,
                        fill: !0,
                        fillColor: null,
                        align: "left",
                        horizontal: !1
                    },
                    shadowSize: 3
                },
                grid: {
                    show: !0,
                    aboveData: !1,
                    color: "#545454",
                    backgroundColor: null,
                    borderColor: null,
                    tickColor: null,
                    labelMargin: 5,
                    axisMargin: 8,
                    borderWidth: 2,
                    minBorderMargin: null,
                    markings: null,
                    markingsColor: "#f4f4f4",
                    markingsLineWidth: 2,
                    clickable: !1,
                    hoverable: !1,
                    autoHighlight: !0,
                    mouseActiveRadius: 10
                },
                hooks: {}
            },
            R = null,
            S = null,
            J = null,
            h = null,
            D = null,
            B = [],
            F = [],
            n = {
                left: 0,
                right: 0,
                top: 0,
                bottom: 0
            },
            E = 0,
            G = 0,
            O = 0,
            K = 0,
            I = {
                processOptions: [],
                processRawData: [],
                processDatapoints: [],
                drawSeries: [],
                draw: [],
                bindEvents: [],
                drawOverlay: [],
                shutdown: []
            },
            y = this;
        y.setData = Z;
        y.setupGrid = ba;
        y.draw = ca;
        y.getPlaceholder = function () {
            return j
        };
        y.getCanvas = function () {
            return R
        };
        y.getPlotOffset = function () {
            return n
        };
        y.width = function () {
            return O
        };
        y.height = function () {
            return K
        };
        y.offset = function () {
            var a = J.offset();
            a.left += n.left;
            a.top += n.top;
            return a
        };
        y.getData = function () {
            return x
        };
        y.getAxes = function () {
            var a = {};
            g.each(B.concat(F), function (d, b) {
                b && (a[b.direction + (b.n != 1 ? b.n : "") + "axis"] = b)
            });
            return a
        };
        y.getXAxes = function () {
            return B
        };
        y.getYAxes = function () {
            return F
        };
        y.c2p = T;
        y.p2c = function (a) {
            var d = {},
                b, e, c;
            for (b = 0; b < B.length; ++b) if ((e = B[b]) && e.used) if (c = "x" + e.n, a[c] == null && e.n == 1 && (c = "x"), a[c] != null) {
                d.left = e.p2c(a[c]);
                break
            }
            for (b = 0; b < F.length; ++b) if ((e = F[b]) && e.used) if (c = "y" + e.n, a[c] == null && e.n == 1 && (c = "y"), a[c] != null) {
                d.top = e.p2c(a[c]);
                break
            }
            return d
        };
        y.getOptions = function () {
            return f
        };
        y.highlight = la;
        y.unhighlight = ka;
        y.triggerRedrawOverlay = W;
        y.pointOffset = function (a) {
            return {
                left: parseInt(B[N(a, "x") - 1].p2c(+a.x) + n.left),
                top: parseInt(F[N(a, "y") - 1].p2c(+a.y) + n.top)
            }
        };
        y.shutdown = function () {
            U && clearTimeout(U);
            J.unbind("mousemove", ha);
            J.unbind("mouseleave", ia);
            J.unbind("click", ja);
            H(I.shutdown, [J])
        };
        y.resize = function () {
            L();
            aa(R);
            aa(S)
        };
        y.hooks = I;
        (function () {
            for (var a = 0; a < q.length; ++a) {
                var d = q[a];
                d.init(y);
                d.options && g.extend(!0, f, d.options)
            }
        })(y);
        (function (a) {
            g.extend(!0, f, a);
            if (f.xaxis.color == null) f.xaxis.color = f.grid.color;
            if (f.yaxis.color == null) f.yaxis.color = f.grid.color;
            if (f.xaxis.tickColor == null) f.xaxis.tickColor = f.grid.tickColor;
            if (f.yaxis.tickColor == null) f.yaxis.tickColor = f.grid.tickColor;
            if (f.grid.borderColor == null) f.grid.borderColor = f.grid.color;
            if (f.grid.tickColor == null) f.grid.tickColor = g.color.parse(f.grid.color).scale("a", 0.22).toString();
            for (a = 0; a < Math.max(1, f.xaxes.length); ++a) f.xaxes[a] = g.extend(!0, {}, f.xaxis, f.xaxes[a]);
            for (a = 0; a < Math.max(1, f.yaxes.length); ++a) f.yaxes[a] = g.extend(!0, {}, f.yaxis, f.yaxes[a]);
            if (f.xaxis.noTicks && f.xaxis.ticks == null) f.xaxis.ticks = f.xaxis.noTicks;
            if (f.yaxis.noTicks && f.yaxis.ticks == null) f.yaxis.ticks = f.yaxis.noTicks;
            if (f.x2axis) f.xaxes[1] = g.extend(!0, {}, f.xaxis, f.x2axis), f.xaxes[1].position = "top";
            if (f.y2axis) f.yaxes[1] = g.extend(!0, {}, f.yaxis, f.y2axis), f.yaxes[1].position = "right";
            if (f.grid.coloredAreas) f.grid.markings = f.grid.coloredAreas;
            if (f.grid.coloredAreasColor) f.grid.markingsColor = f.grid.coloredAreasColor;
            f.lines && g.extend(!0, f.series.lines, f.lines);
            f.points && g.extend(!0, f.series.points, f.points);
            f.bars && g.extend(!0, f.series.bars, f.bars);
            if (f.shadowSize != null) f.series.shadowSize = f.shadowSize;
            for (a = 0; a < f.xaxes.length; ++a) P(B, a + 1).options = f.xaxes[a];
            for (a = 0; a < f.yaxes.length; ++a) P(F, a + 1).options = f.yaxes[a];
            for (var d in I) f.hooks[d] && f.hooks[d].length && (I[d] = I[d].concat(f.hooks[d]));
            H(I.processOptions, [f])
        })(V);
        (function () {
            var a;
            a = j.children("canvas.base");
            var d = j.children("canvas.overlay");
            a.length == 0 || d == 0 ? (j.html(""), j.css({
                padding: 0
            }), j.css("position") == "static" && j.css("position", "relative"), L(), R = $(!0, "base"), S = $(!1, "overlay"), a = !1) : (R = a.get(0), S = d.get(0), a = !0);
            h = R.getContext("2d");
            D = S.getContext("2d");
            J = g([S, R]);
            a && (j.data("plot").shutdown(), y.resize(), D.clearRect(0, 0, E, G), J.unbind(), j.children().not([R, S]).remove());
            j.data("plot", y)
        })();
        Z(t);
        ba();
        ca();
        f.grid.hoverable && (J.mousemove(ha), J.mouseleave(ia));
        f.grid.clickable && J.click(ja);
        H(I.bindEvents, [J]);
        var M = [],
            U = null
    }
    function w(g, t) {
        return t * Math.floor(g / t)
    }
    g.plot = function (j, t, w) {
        return new L(g(j), t, w, g.plot.plugins)
    };
    g.plot.version = "0.7";
    g.plot.plugins = [];
    g.plot.formatDate = function (g, t, w) {
        var q = function (g) {
                g = "" + g;
                return g.length == 1 ? "0" + g : g
            },
            H = [],
            L = !1,
            N = !1,
            A = g.getUTCHours(),
            T = A < 12;
        w == null && (w = "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","));
        t.search(/%p|%P/) != -1 && (A > 12 ? A -= 12 : A == 0 && (A = 12));
        for (var P = 0; P < t.length; ++P) {
            var C = t.charAt(P);
            if (L) {
                switch (C) {
                case "h":
                    C = "" + A;
                    break;
                case "H":
                    C = q(A);
                    break;
                case "M":
                    C = q(g.getUTCMinutes());
                    break;
                case "S":
                    C = q(g.getUTCSeconds());
                    break;
                case "d":
                    C = "" + g.getUTCDate();
                    break;
                case "m":
                    C = "" + (g.getUTCMonth() + 1);
                    break;
                case "y":
                    C = "" + g.getUTCFullYear();
                    break;
                case "b":
                    C = "" + w[g.getUTCMonth()];
                    break;
                case "p":
                    C = T ? "am" : "pm";
                    break;
                case "P":
                    C = T ? "AM" : "PM";
                    break;
                case "0":
                    C = "", N = !0
                }
                C && N && (C = q(C), N = !1);
                H.push(C);
                N || (L = !1)
            } else C == "%" ? L = !0 : H.push(C)
        }
        return H.join("")
    }
})(jQuery);
/* Javascript plotting library for jQuery, v. 0.7.
 *
 * Released under the MIT license by IOLA, December 2007.
 *
 */
(function (b) {
    b.color = {};
    b.color.make = function (d, e, g, f) {
        var c = {};
        c.r = d || 0;
        c.g = e || 0;
        c.b = g || 0;
        c.a = f != null ? f : 1;
        c.add = function (h, j) {
            for (var k = 0; k < h.length; ++k) {
                c[h.charAt(k)] += j
            }
            return c.normalize()
        };
        c.scale = function (h, j) {
            for (var k = 0; k < h.length; ++k) {
                c[h.charAt(k)] *= j
            }
            return c.normalize()
        };
        c.toString = function () {
            if (c.a >= 1) {
                return "rgb(" + [c.r, c.g, c.b].join(",") + ")"
            } else {
                return "rgba(" + [c.r, c.g, c.b, c.a].join(",") + ")"
            }
        };
        c.normalize = function () {
            function h(k, j, l) {
                return j < k ? k : (j > l ? l : j)
            }
            c.r = h(0, parseInt(c.r), 255);
            c.g = h(0, parseInt(c.g), 255);
            c.b = h(0, parseInt(c.b), 255);
            c.a = h(0, c.a, 1);
            return c
        };
        c.clone = function () {
            return b.color.make(c.r, c.b, c.g, c.a)
        };
        return c.normalize()
    };
    b.color.extract = function (d, e) {
        var c;
        do {
            c = d.css(e).toLowerCase();
            if (c != "" && c != "transparent") {
                break
            }
            d = d.parent()
        } while (!b.nodeName(d.get(0), "body"));
        if (c == "rgba(0, 0, 0, 0)") {
            c = "transparent"
        }
        return b.color.parse(c)
    };
    b.color.parse = function (c) {
        var d, f = b.color.make;
        if (d = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c)) {
            return f(parseInt(d[1], 10), parseInt(d[2], 10), parseInt(d[3], 10))
        }
        if (d = /rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(c)) {
            return f(parseInt(d[1], 10), parseInt(d[2], 10), parseInt(d[3], 10), parseFloat(d[4]))
        }
        if (d = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c)) {
            return f(parseFloat(d[1]) * 2.55, parseFloat(d[2]) * 2.55, parseFloat(d[3]) * 2.55)
        }
        if (d = /rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(c)) {
            return f(parseFloat(d[1]) * 2.55, parseFloat(d[2]) * 2.55, parseFloat(d[3]) * 2.55, parseFloat(d[4]))
        }
        if (d = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c)) {
            return f(parseInt(d[1], 16), parseInt(d[2], 16), parseInt(d[3], 16))
        }
        if (d = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c)) {
            return f(parseInt(d[1] + d[1], 16), parseInt(d[2] + d[2], 16), parseInt(d[3] + d[3], 16))
        }
        var e = b.trim(c).toLowerCase();
        if (e == "transparent") {
            return f(255, 255, 255, 0)
        } else {
            d = a[e] || [0, 0, 0];
            return f(d[0], d[1], d[2])
        }
    };
    var a = {
        aqua: [0, 255, 255],
        azure: [240, 255, 255],
        beige: [245, 245, 220],
        black: [0, 0, 0],
        blue: [0, 0, 255],
        brown: [165, 42, 42],
        cyan: [0, 255, 255],
        darkblue: [0, 0, 139],
        darkcyan: [0, 139, 139],
        darkgrey: [169, 169, 169],
        darkgreen: [0, 100, 0],
        darkkhaki: [189, 183, 107],
        darkmagenta: [139, 0, 139],
        darkolivegreen: [85, 107, 47],
        darkorange: [255, 140, 0],
        darkorchid: [153, 50, 204],
        darkred: [139, 0, 0],
        darksalmon: [233, 150, 122],
        darkviolet: [148, 0, 211],
        fuchsia: [255, 0, 255],
        gold: [255, 215, 0],
        green: [0, 128, 0],
        indigo: [75, 0, 130],
        khaki: [240, 230, 140],
        lightblue: [173, 216, 230],
        lightcyan: [224, 255, 255],
        lightgreen: [144, 238, 144],
        lightgrey: [211, 211, 211],
        lightpink: [255, 182, 193],
        lightyellow: [255, 255, 224],
        lime: [0, 255, 0],
        magenta: [255, 0, 255],
        maroon: [128, 0, 0],
        navy: [0, 0, 128],
        olive: [128, 128, 0],
        orange: [255, 165, 0],
        pink: [255, 192, 203],
        purple: [128, 0, 128],
        violet: [128, 0, 128],
        red: [255, 0, 0],
        silver: [192, 192, 192],
        white: [255, 255, 255],
        yellow: [255, 255, 0]
    }
})(jQuery);
(function (c) {
    function b(av, ai, J, af) {
        var Q = [],
            O = {
                colors: ["#edc240", "#afd8f8", "#cb4b4b", "#4da74d", "#9440ed"],
                legend: {
                    show: true,
                    noColumns: 1,
                    labelFormatter: null,
                    labelBoxBorderColor: "#ccc",
                    container: null,
                    position: "ne",
                    margin: 5,
                    backgroundColor: null,
                    backgroundOpacity: 0.85
                },
                xaxis: {
                    show: null,
                    position: "bottom",
                    mode: null,
                    color: null,
                    tickColor: null,
                    transform: null,
                    inverseTransform: null,
                    min: null,
                    max: null,
                    autoscaleMargin: null,
                    ticks: null,
                    tickFormatter: null,
                    labelWidth: null,
                    labelHeight: null,
                    reserveSpace: null,
                    tickLength: null,
                    alignTicksWithAxis: null,
                    tickDecimals: null,
                    tickSize: null,
                    minTickSize: null,
                    monthNames: null,
                    timeformat: null,
                    twelveHourClock: false
                },
                yaxis: {
                    autoscaleMargin: 0.02,
                    position: "left"
                },
                xaxes: [],
                yaxes: [],
                series: {
                    points: {
                        show: false,
                        radius: 3,
                        lineWidth: 2,
                        fill: true,
                        fillColor: "#ffffff",
                        symbol: "circle"
                    },
                    lines: {
                        lineWidth: 2,
                        fill: false,
                        fillColor: null,
                        steps: false
                    },
                    bars: {
                        show: false,
                        lineWidth: 2,
                        barWidth: 1,
                        fill: true,
                        fillColor: null,
                        align: "left",
                        horizontal: false
                    },
                    shadowSize: 3
                },
                grid: {
                    show: true,
                    aboveData: false,
                    color: "#545454",
                    backgroundColor: null,
                    borderColor: null,
                    tickColor: null,
                    labelMargin: 5,
                    axisMargin: 8,
                    borderWidth: 2,
                    minBorderMargin: null,
                    markings: null,
                    markingsColor: "#f4f4f4",
                    markingsLineWidth: 2,
                    clickable: false,
                    hoverable: false,
                    autoHighlight: true,
                    mouseActiveRadius: 10
                },
                hooks: {}
            },
            az = null,
            ad = null,
            y = null,
            H = null,
            A = null,
            p = [],
            aw = [],
            q = {
                left: 0,
                right: 0,
                top: 0,
                bottom: 0
            },
            G = 0,
            I = 0,
            h = 0,
            w = 0,
            ak = {
                processOptions: [],
                processRawData: [],
                processDatapoints: [],
                drawSeries: [],
                draw: [],
                bindEvents: [],
                drawOverlay: [],
                shutdown: []
            },
            aq = this;
        aq.setData = aj;
        aq.setupGrid = t;
        aq.draw = W;
        aq.getPlaceholder = function () {
            return av
        };
        aq.getCanvas = function () {
            return az
        };
        aq.getPlotOffset = function () {
            return q
        };
        aq.width = function () {
            return h
        };
        aq.height = function () {
            return w
        };
        aq.offset = function () {
            var aB = y.offset();
            aB.left += q.left;
            aB.top += q.top;
            return aB
        };
        aq.getData = function () {
            return Q
        };
        aq.getAxes = function () {
            var aC = {},
                aB;
            c.each(p.concat(aw), function (aD, aE) {
                if (aE) {
                    aC[aE.direction + (aE.n != 1 ? aE.n : "") + "axis"] = aE
                }
            });
            return aC
        };
        aq.getXAxes = function () {
            return p
        };
        aq.getYAxes = function () {
            return aw
        };
        aq.c2p = C;
        aq.p2c = ar;
        aq.getOptions = function () {
            return O
        };
        aq.highlight = x;
        aq.unhighlight = T;
        aq.triggerRedrawOverlay = f;
        aq.pointOffset = function (aB) {
            return {
                left: parseInt(p[aA(aB, "x") - 1].p2c(+aB.x) + q.left),
                top: parseInt(aw[aA(aB, "y") - 1].p2c(+aB.y) + q.top)
            }
        };
        aq.shutdown = ag;
        aq.resize = function () {
            B();
            g(az);
            g(ad)
        };
        aq.hooks = ak;
        F(aq);
        Z(J);
        X();
        aj(ai);
        t();
        W();
        ah();

        function an(aD, aB) {
            aB = [aq].concat(aB);
            for (var aC = 0; aC < aD.length; ++aC) {
                aD[aC].apply(this, aB)
            }
        }
        function F() {
            for (var aB = 0; aB < af.length; ++aB) {
                var aC = af[aB];
                aC.init(aq);
                if (aC.options) {
                    c.extend(true, O, aC.options)
                }
            }
        }
        function Z(aC) {
            var aB;
            c.extend(true, O, aC);
            if (O.xaxis.color == null) {
                O.xaxis.color = O.grid.color
            }
            if (O.yaxis.color == null) {
                O.yaxis.color = O.grid.color
            }
            if (O.xaxis.tickColor == null) {
                O.xaxis.tickColor = O.grid.tickColor
            }
            if (O.yaxis.tickColor == null) {
                O.yaxis.tickColor = O.grid.tickColor
            }
            if (O.grid.borderColor == null) {
                O.grid.borderColor = O.grid.color
            }
            if (O.grid.tickColor == null) {
                O.grid.tickColor = c.color.parse(O.grid.color).scale("a", 0.22).toString()
            }
            for (aB = 0; aB < Math.max(1, O.xaxes.length); ++aB) {
                O.xaxes[aB] = c.extend(true, {}, O.xaxis, O.xaxes[aB])
            }
            for (aB = 0; aB < Math.max(1, O.yaxes.length); ++aB) {
                O.yaxes[aB] = c.extend(true, {}, O.yaxis, O.yaxes[aB])
            }
            if (O.xaxis.noTicks && O.xaxis.ticks == null) {
                O.xaxis.ticks = O.xaxis.noTicks
            }
            if (O.yaxis.noTicks && O.yaxis.ticks == null) {
                O.yaxis.ticks = O.yaxis.noTicks
            }
            if (O.x2axis) {
                O.xaxes[1] = c.extend(true, {}, O.xaxis, O.x2axis);
                O.xaxes[1].position = "top"
            }
            if (O.y2axis) {
                O.yaxes[1] = c.extend(true, {}, O.yaxis, O.y2axis);
                O.yaxes[1].position = "right"
            }
            if (O.grid.coloredAreas) {
                O.grid.markings = O.grid.coloredAreas
            }
            if (O.grid.coloredAreasColor) {
                O.grid.markingsColor = O.grid.coloredAreasColor
            }
            if (O.lines) {
                c.extend(true, O.series.lines, O.lines)
            }
            if (O.points) {
                c.extend(true, O.series.points, O.points)
            }
            if (O.bars) {
                c.extend(true, O.series.bars, O.bars)
            }
            if (O.shadowSize != null) {
                O.series.shadowSize = O.shadowSize
            }
            for (aB = 0; aB < O.xaxes.length; ++aB) {
                V(p, aB + 1).options = O.xaxes[aB]
            }
            for (aB = 0; aB < O.yaxes.length; ++aB) {
                V(aw, aB + 1).options = O.yaxes[aB]
            }
            for (var aD in ak) {
                if (O.hooks[aD] && O.hooks[aD].length) {
                    ak[aD] = ak[aD].concat(O.hooks[aD])
                }
            }
            an(ak.processOptions, [O])
        }
        function aj(aB) {
            Q = Y(aB);
            ax();
            z()
        }
        function Y(aE) {
            var aC = [];
            for (var aB = 0; aB < aE.length; ++aB) {
                var aD = c.extend(true, {}, O.series);
                if (aE[aB].data != null) {
                    aD.data = aE[aB].data;
                    delete aE[aB].data;
                    c.extend(true, aD, aE[aB]);
                    aE[aB].data = aD.data
                } else {
                    aD.data = aE[aB]
                }
                aC.push(aD)
            }
            return aC
        }
        function aA(aC, aD) {
            var aB = aC[aD + "axis"];
            if (typeof aB == "object") {
                aB = aB.n
            }
            if (typeof aB != "number") {
                aB = 1
            }
            return aB
        }
        function m() {
            return c.grep(p.concat(aw), function (aB) {
                return aB
            })
        }
        function C(aE) {
            var aC = {},
                aB, aD;
            for (aB = 0; aB < p.length; ++aB) {
                aD = p[aB];
                if (aD && aD.used) {
                    aC["x" + aD.n] = aD.c2p(aE.left)
                }
            }
            for (aB = 0; aB < aw.length; ++aB) {
                aD = aw[aB];
                if (aD && aD.used) {
                    aC["y" + aD.n] = aD.c2p(aE.top)
                }
            }
            if (aC.x1 !== undefined) {
                aC.x = aC.x1
            }
            if (aC.y1 !== undefined) {
                aC.y = aC.y1
            }
            return aC
        }
        function ar(aF) {
            var aD = {},
                aC, aE, aB;
            for (aC = 0; aC < p.length; ++aC) {
                aE = p[aC];
                if (aE && aE.used) {
                    aB = "x" + aE.n;
                    if (aF[aB] == null && aE.n == 1) {
                        aB = "x"
                    }
                    if (aF[aB] != null) {
                        aD.left = aE.p2c(aF[aB]);
                        break
                    }
                }
            }
            for (aC = 0; aC < aw.length; ++aC) {
                aE = aw[aC];
                if (aE && aE.used) {
                    aB = "y" + aE.n;
                    if (aF[aB] == null && aE.n == 1) {
                        aB = "y"
                    }
                    if (aF[aB] != null) {
                        aD.top = aE.p2c(aF[aB]);
                        break
                    }
                }
            }
            return aD
        }
        function V(aC, aB) {
            if (!aC[aB - 1]) {
                aC[aB - 1] = {
                    n: aB,
                    direction: aC == p ? "x" : "y",
                    options: c.extend(true, {}, aC == p ? O.xaxis : O.yaxis)
                }
            }
            return aC[aB - 1]
        }
        function ax() {
            var aG;
            var aM = Q.length,
                aB = [],
                aE = [];
            for (aG = 0; aG < Q.length; ++aG) {
                var aJ = Q[aG].color;
                if (aJ != null) {
                    --aM;
                    if (typeof aJ == "number") {
                        aE.push(aJ)
                    } else {
                        aB.push(c.color.parse(Q[aG].color))
                    }
                }
            }
            for (aG = 0; aG < aE.length; ++aG) {
                aM = Math.max(aM, aE[aG] + 1)
            }
            var aC = [],
                aF = 0;
            aG = 0;
            while (aC.length < aM) {
                var aI;
                if (O.colors.length == aG) {
                    aI = c.color.make(100, 100, 100)
                } else {
                    aI = c.color.parse(O.colors[aG])
                }
                var aD = aF % 2 == 1 ? -1 : 1;
                aI.scale("rgb", 1 + aD * Math.ceil(aF / 2) * 0.2);
                aC.push(aI);
                ++aG;
                if (aG >= O.colors.length) {
                    aG = 0;
                    ++aF
                }
            }
            var aH = 0,
                aN;
            for (aG = 0; aG < Q.length; ++aG) {
                aN = Q[aG];
                if (aN.color == null) {
                    aN.color = aC[aH].toString();
                    ++aH
                } else {
                    if (typeof aN.color == "number") {
                        aN.color = aC[aN.color].toString()
                    }
                }
                if (aN.lines.show == null) {
                    var aL, aK = true;
                    for (aL in aN) {
                        if (aN[aL] && aN[aL].show) {
                            aK = false;
                            break
                        }
                    }
                    if (aK) {
                        aN.lines.show = true
                    }
                }
                aN.xaxis = V(p, aA(aN, "x"));
                aN.yaxis = V(aw, aA(aN, "y"))
            }
        }
        function z() {
            var aO = Number.POSITIVE_INFINITY,
                aI = Number.NEGATIVE_INFINITY,
                aB = Number.MAX_VALUE,
                aU, aS, aR, aN, aD, aJ, aT, aP, aH, aG, aC, a0, aX, aL;

            function aF(a3, a2, a1) {
                if (a2 < a3.datamin && a2 != -aB) {
                    a3.datamin = a2
                }
                if (a1 > a3.datamax && a1 != aB) {
                    a3.datamax = a1
                }
            }
            c.each(m(), function (a1, a2) {
                a2.datamin = aO;
                a2.datamax = aI;
                a2.used = false
            });
            for (aU = 0; aU < Q.length; ++aU) {
                aJ = Q[aU];
                aJ.datapoints = {
                    points: []
                };
                an(ak.processRawData, [aJ, aJ.data, aJ.datapoints])
            }
            for (aU = 0; aU < Q.length; ++aU) {
                aJ = Q[aU];
                var aZ = aJ.data,
                    aW = aJ.datapoints.format;
                if (!aW) {
                    aW = [];
                    aW.push({
                        x: true,
                        number: true,
                        required: true
                    });
                    aW.push({
                        y: true,
                        number: true,
                        required: true
                    });
                    if (aJ.bars.show || (aJ.lines.show && aJ.lines.fill)) {
                        aW.push({
                            y: true,
                            number: true,
                            required: false,
                            defaultValue: 0
                        });
                        if (aJ.bars.horizontal) {
                            delete aW[aW.length - 1].y;
                            aW[aW.length - 1].x = true
                        }
                    }
                    aJ.datapoints.format = aW
                }
                if (aJ.datapoints.pointsize != null) {
                    continue
                }
                aJ.datapoints.pointsize = aW.length;
                aP = aJ.datapoints.pointsize;
                aT = aJ.datapoints.points;
                insertSteps = aJ.lines.show && aJ.lines.steps;
                aJ.xaxis.used = aJ.yaxis.used = true;
                for (aS = aR = 0; aS < aZ.length; ++aS, aR += aP) {
                    aL = aZ[aS];
                    var aE = aL == null;
                    if (!aE) {
                        for (aN = 0; aN < aP; ++aN) {
                            a0 = aL[aN];
                            aX = aW[aN];
                            if (aX) {
                                if (aX.number && a0 != null) {
                                    a0 = +a0;
                                    if (isNaN(a0)) {
                                        a0 = null
                                    } else {
                                        if (a0 == Infinity) {
                                            a0 = aB
                                        } else {
                                            if (a0 == -Infinity) {
                                                a0 = -aB
                                            }
                                        }
                                    }
                                }
                                if (a0 == null) {
                                    if (aX.required) {
                                        aE = true
                                    }
                                    if (aX.defaultValue != null) {
                                        a0 = aX.defaultValue
                                    }
                                }
                            }
                            aT[aR + aN] = a0
                        }
                    }
                    if (aE) {
                        for (aN = 0; aN < aP; ++aN) {
                            a0 = aT[aR + aN];
                            if (a0 != null) {
                                aX = aW[aN];
                                if (aX.x) {
                                    aF(aJ.xaxis, a0, a0)
                                }
                                if (aX.y) {
                                    aF(aJ.yaxis, a0, a0)
                                }
                            }
                            aT[aR + aN] = null
                        }
                    } else {
                        if (insertSteps && aR > 0 && aT[aR - aP] != null && aT[aR - aP] != aT[aR] && aT[aR - aP + 1] != aT[aR + 1]) {
                            for (aN = 0; aN < aP; ++aN) {
                                aT[aR + aP + aN] = aT[aR + aN]
                            }
                            aT[aR + 1] = aT[aR - aP + 1];
                            aR += aP
                        }
                    }
                }
            }
            for (aU = 0; aU < Q.length; ++aU) {
                aJ = Q[aU];
                an(ak.processDatapoints, [aJ, aJ.datapoints])
            }
            for (aU = 0; aU < Q.length; ++aU) {
                aJ = Q[aU];
                aT = aJ.datapoints.points, aP = aJ.datapoints.pointsize;
                var aK = aO,
                    aQ = aO,
                    aM = aI,
                    aV = aI;
                for (aS = 0; aS < aT.length; aS += aP) {
                    if (aT[aS] == null) {
                        continue
                    }
                    for (aN = 0; aN < aP; ++aN) {
                        a0 = aT[aS + aN];
                        aX = aW[aN];
                        if (!aX || a0 == aB || a0 == -aB) {
                            continue
                        }
                        if (aX.x) {
                            if (a0 < aK) {
                                aK = a0
                            }
                            if (a0 > aM) {
                                aM = a0
                            }
                        }
                        if (aX.y) {
                            if (a0 < aQ) {
                                aQ = a0
                            }
                            if (a0 > aV) {
                                aV = a0
                            }
                        }
                    }
                }
                if (aJ.bars.show) {
                    var aY = aJ.bars.align == "left" ? 0 : -aJ.bars.barWidth / 2;
                    if (aJ.bars.horizontal) {
                        aQ += aY;
                        aV += aY + aJ.bars.barWidth
                    } else {
                        aK += aY;
                        aM += aY + aJ.bars.barWidth
                    }
                }
                aF(aJ.xaxis, aK, aM);
                aF(aJ.yaxis, aQ, aV)
            }
            c.each(m(), function (a1, a2) {
                if (a2.datamin == aO) {
                    a2.datamin = null
                }
                if (a2.datamax == aI) {
                    a2.datamax = null
                }
            })
        }
        function j(aB, aC) {
            var aD = document.createElement("canvas");
            aD.className = aC;
            aD.width = G;
            aD.height = I;
            if (!aB) {
                c(aD).css({
                    position: "absolute",
                    left: 0,
                    top: 0
                })
            }
            c(aD).appendTo(av);
            if (!aD.getContext) {
                aD = window.G_vmlCanvasManager.initElement(aD)
            }
            aD.getContext("2d").save();
            return aD
        }
        function B() {
            G = av.width();
            I = av.height();
            if (G <= 0 || I <= 0) {
                throw "Invalid dimensions for plot, width = " + G + ", height = " + I
            }
        }
        function g(aC) {
            if (aC.width != G) {
                aC.width = G
            }
            if (aC.height != I) {
                aC.height = I
            }
            var aB = aC.getContext("2d");
            aB.restore();
            aB.save()
        }
        function X() {
            var aC, aB = av.children("canvas.base"),
                aD = av.children("canvas.overlay");
            if (aB.length == 0 || aD == 0) {
                av.html("");
                av.css({
                    padding: 0
                });
                if (av.css("position") == "static") {
                    av.css("position", "relative")
                }
                B();
                az = j(true, "base");
                ad = j(false, "overlay");
                aC = false
            } else {
                az = aB.get(0);
                ad = aD.get(0);
                aC = true
            }
            H = az.getContext("2d");
            A = ad.getContext("2d");
            y = c([ad, az]);
            if (aC) {
                av.data("plot").shutdown();
                aq.resize();
                A.clearRect(0, 0, G, I);
                y.unbind();
                av.children().not([az, ad]).remove()
            }
            av.data("plot", aq)
        }
        function ah() {
            if (O.grid.hoverable) {
                y.mousemove(aa);
                y.mouseleave(l)
            }
            if (O.grid.clickable) {
                y.click(R)
            }
            an(ak.bindEvents, [y])
        }
        function ag() {
            if (M) {
                clearTimeout(M)
            }
            y.unbind("mousemove", aa);
            y.unbind("mouseleave", l);
            y.unbind("click", R);
            an(ak.shutdown, [y])
        }
        function r(aG) {
            function aC(aH) {
                return aH
            }
            var aF, aB, aD = aG.options.transform || aC,
                aE = aG.options.inverseTransform;
            if (aG.direction == "x") {
                aF = aG.scale = h / Math.abs(aD(aG.max) - aD(aG.min));
                aB = Math.min(aD(aG.max), aD(aG.min))
            } else {
                aF = aG.scale = w / Math.abs(aD(aG.max) - aD(aG.min));
                aF = -aF;
                aB = Math.max(aD(aG.max), aD(aG.min))
            }
            if (aD == aC) {
                aG.p2c = function (aH) {
                    return (aH - aB) * aF
                }
            } else {
                aG.p2c = function (aH) {
                    return (aD(aH) - aB) * aF
                }
            }
            if (!aE) {
                aG.c2p = function (aH) {
                    return aB + aH / aF
                }
            } else {
                aG.c2p = function (aH) {
                    return aE(aB + aH / aF)
                }
            }
        }
        function L(aD) {
            var aB = aD.options,
                aF, aJ = aD.ticks || [],
                aI = [],
                aE, aK = aB.labelWidth,
                aG = aB.labelHeight,
                aC;

            function aH(aM, aL) {
                return c('<div style="position:absolute;top:-10000px;' + aL + 'font-size:smaller"><div class="' + aD.direction + "Axis " + aD.direction + aD.n + 'Axis">' + aM.join("") + "</div></div>").appendTo(av)
            }
            if (aD.direction == "x") {
                if (aK == null) {
                    aK = Math.floor(G / (aJ.length > 0 ? aJ.length : 1))
                }
                if (aG == null) {
                    aI = [];
                    for (aF = 0; aF < aJ.length; ++aF) {
                        aE = aJ[aF].label;
                        if (aE) {
                            aI.push('<div class="tickLabel" style="float:left;width:' + aK + 'px">' + aE + "</div>")
                        }
                    }
                    if (aI.length > 0) {
                        aI.push('<div style="clear:left"></div>');
                        aC = aH(aI, "width:10000px;");
                        aG = aC.height();
                        aC.remove()
                    }
                }
            } else {
                if (aK == null || aG == null) {
                    for (aF = 0; aF < aJ.length; ++aF) {
                        aE = aJ[aF].label;
                        if (aE) {
                            aI.push('<div class="tickLabel">' + aE + "</div>")
                        }
                    }
                    if (aI.length > 0) {
                        aC = aH(aI, "");
                        if (aK == null) {
                            aK = aC.children().width()
                        }
                        if (aG == null) {
                            aG = aC.find("div.tickLabel").height()
                        }
                        aC.remove()
                    }
                }
            }
            if (aK == null) {
                aK = 0
            }
            if (aG == null) {
                aG = 0
            }
            aD.labelWidth = aK;
            aD.labelHeight = aG
        }
        function au(aD) {
            var aC = aD.labelWidth,
                aL = aD.labelHeight,
                aH = aD.options.position,
                aF = aD.options.tickLength,
                aG = O.grid.axisMargin,
                aJ = O.grid.labelMargin,
                aK = aD.direction == "x" ? p : aw,
                aE;
            var aB = c.grep(aK, function (aN) {
                return aN && aN.options.position == aH && aN.reserveSpace
            });
            if (c.inArray(aD, aB) == aB.length - 1) {
                aG = 0
            }
            if (aF == null) {
                aF = "full"
            }
            var aI = c.grep(aK, function (aN) {
                return aN && aN.reserveSpace
            });
            var aM = c.inArray(aD, aI) == 0;
            if (!aM && aF == "full") {
                aF = 5
            }
            if (!isNaN(+aF)) {
                aJ += +aF
            }
            if (aD.direction == "x") {
                aL += aJ;
                if (aH == "bottom") {
                    q.bottom += aL + aG;
                    aD.box = {
                        top: I - q.bottom,
                        height: aL
                    }
                } else {
                    aD.box = {
                        top: q.top + aG,
                        height: aL
                    };
                    q.top += aL + aG
                }
            } else {
                aC += aJ;
                if (aH == "left") {
                    aD.box = {
                        left: q.left + aG,
                        width: aC
                    };
                    q.left += aC + aG
                } else {
                    q.right += aC + aG;
                    aD.box = {
                        left: G - q.right,
                        width: aC
                    }
                }
            }
            aD.position = aH;
            aD.tickLength = aF;
            aD.box.padding = aJ;
            aD.innermost = aM
        }
        function U(aB) {
            if (aB.direction == "x") {
                aB.box.left = q.left;
                aB.box.width = h
            } else {
                aB.box.top = q.top;
                aB.box.height = w
            }
        }
        function t() {
            var aC, aE = m();
            c.each(aE, function (aF, aG) {
                aG.show = aG.options.show;
                if (aG.show == null) {
                    aG.show = aG.used
                }
                aG.reserveSpace = aG.show || aG.options.reserveSpace;
                n(aG)
            });
            allocatedAxes = c.grep(aE, function (aF) {
                return aF.reserveSpace
            });
            q.left = q.right = q.top = q.bottom = 0;
            if (O.grid.show) {
                c.each(allocatedAxes, function (aF, aG) {
                    S(aG);
                    P(aG);
                    ap(aG, aG.ticks);
                    L(aG)
                });
                for (aC = allocatedAxes.length - 1; aC >= 0; --aC) {
                    au(allocatedAxes[aC])
                }
                var aD = O.grid.minBorderMargin;
                if (aD == null) {
                    aD = 0;
                    for (aC = 0; aC < Q.length; ++aC) {
                        aD = Math.max(aD, Q[aC].points.radius + Q[aC].points.lineWidth / 2)
                    }
                }
                for (var aB in q) {
                    q[aB] += O.grid.borderWidth;
                    q[aB] = Math.max(aD, q[aB])
                }
            }
            h = G - q.left - q.right;
            w = I - q.bottom - q.top;
            c.each(aE, function (aF, aG) {
                r(aG)
            });
            if (O.grid.show) {
                c.each(allocatedAxes, function (aF, aG) {
                    U(aG)
                });
                k()
            }
            o()
        }
        function n(aE) {
            var aF = aE.options,
                aD = +(aF.min != null ? aF.min : aE.datamin),
                aB = +(aF.max != null ? aF.max : aE.datamax),
                aH = aB - aD;
            if (aH == 0) {
                var aC = aB == 0 ? 1 : 0.01;
                if (aF.min == null) {
                    aD -= aC
                }
                if (aF.max == null || aF.min != null) {
                    aB += aC
                }
            } else {
                var aG = aF.autoscaleMargin;
                if (aG != null) {
                    if (aF.min == null) {
                        aD -= aH * aG;
                        if (aD < 0 && aE.datamin != null && aE.datamin >= 0) {
                            aD = 0
                        }
                    }
                    if (aF.max == null) {
                        aB += aH * aG;
                        if (aB > 0 && aE.datamax != null && aE.datamax <= 0) {
                            aB = 0
                        }
                    }
                }
            }
            aE.min = aD;
            aE.max = aB
        }
        function S(aG) {
            var aM = aG.options;
            var aH;
            if (typeof aM.ticks == "number" && aM.ticks > 0) {
                aH = aM.ticks
            } else {
                aH = 0.3 * Math.sqrt(aG.direction == "x" ? G : I)
            }
            var aT = (aG.max - aG.min) / aH,
                aO, aB, aN, aR, aS, aQ, aI;
            if (aM.mode == "time") {
                var aJ = {
                    second: 1000,
                    minute: 60 * 1000,
                    hour: 60 * 60 * 1000,
                    day: 24 * 60 * 60 * 1000,
                    month: 30 * 24 * 60 * 60 * 1000,
                    year: 365.2425 * 24 * 60 * 60 * 1000
                };
                var aK = [
                    [1, "second"],
                    [2, "second"],
                    [5, "second"],
                    [10, "second"],
                    [30, "second"],
                    [1, "minute"],
                    [2, "minute"],
                    [5, "minute"],
                    [10, "minute"],
                    [30, "minute"],
                    [1, "hour"],
                    [2, "hour"],
                    [4, "hour"],
                    [8, "hour"],
                    [12, "hour"],
                    [1, "day"],
                    [2, "day"],
                    [3, "day"],
                    [0.25, "month"],
                    [0.5, "month"],
                    [1, "month"],
                    [2, "month"],
                    [3, "month"],
                    [6, "month"],
                    [1, "year"]
                ];
                var aC = 0;
                if (aM.minTickSize != null) {
                    if (typeof aM.tickSize == "number") {
                        aC = aM.tickSize
                    } else {
                        aC = aM.minTickSize[0] * aJ[aM.minTickSize[1]]
                    }
                }
                for (var aS = 0; aS < aK.length - 1; ++aS) {
                    if (aT < (aK[aS][0] * aJ[aK[aS][1]] + aK[aS + 1][0] * aJ[aK[aS + 1][1]]) / 2 && aK[aS][0] * aJ[aK[aS][1]] >= aC) {
                        break
                    }
                }
                aO = aK[aS][0];
                aN = aK[aS][1];
                if (aN == "year") {
                    aQ = Math.pow(10, Math.floor(Math.log(aT / aJ.year) / Math.LN10));
                    aI = (aT / aJ.year) / aQ;
                    if (aI < 1.5) {
                        aO = 1
                    } else {
                        if (aI < 3) {
                            aO = 2
                        } else {
                            if (aI < 7.5) {
                                aO = 5
                            } else {
                                aO = 10
                            }
                        }
                    }
                    aO *= aQ
                }
                aG.tickSize = aM.tickSize || [aO, aN];
                aB = function (aX) {
                    var a2 = [],
                        a0 = aX.tickSize[0],
                        a3 = aX.tickSize[1],
                        a1 = new Date(aX.min);
                    var aW = a0 * aJ[a3];
                    if (a3 == "second") {
                        a1.setUTCSeconds(a(a1.getUTCSeconds(), a0))
                    }
                    if (a3 == "minute") {
                        a1.setUTCMinutes(a(a1.getUTCMinutes(), a0))
                    }
                    if (a3 == "hour") {
                        a1.setUTCHours(a(a1.getUTCHours(), a0))
                    }
                    if (a3 == "month") {
                        a1.setUTCMonth(a(a1.getUTCMonth(), a0))
                    }
                    if (a3 == "year") {
                        a1.setUTCFullYear(a(a1.getUTCFullYear(), a0))
                    }
                    a1.setUTCMilliseconds(0);
                    if (aW >= aJ.minute) {
                        a1.setUTCSeconds(0)
                    }
                    if (aW >= aJ.hour) {
                        a1.setUTCMinutes(0)
                    }
                    if (aW >= aJ.day) {
                        a1.setUTCHours(0)
                    }
                    if (aW >= aJ.day * 4) {
                        a1.setUTCDate(1)
                    }
                    if (aW >= aJ.year) {
                        a1.setUTCMonth(0)
                    }
                    var a5 = 0,
                        a4 = Number.NaN,
                        aY;
                    do {
                        aY = a4;
                        a4 = a1.getTime();
                        a2.push(a4);
                        if (a3 == "month") {
                            if (a0 < 1) {
                                a1.setUTCDate(1);
                                var aV = a1.getTime();
                                a1.setUTCMonth(a1.getUTCMonth() + 1);
                                var aZ = a1.getTime();
                                a1.setTime(a4 + a5 * aJ.hour + (aZ - aV) * a0);
                                a5 = a1.getUTCHours();
                                a1.setUTCHours(0)
                            } else {
                                a1.setUTCMonth(a1.getUTCMonth() + a0)
                            }
                        } else {
                            if (a3 == "year") {
                                a1.setUTCFullYear(a1.getUTCFullYear() + a0)
                            } else {
                                a1.setTime(a4 + aW)
                            }
                        }
                    } while (a4 < aX.max && a4 != aY);
                    return a2
                };
                aR = function (aV, aY) {
                    var a0 = new Date(aV);
                    if (aM.timeformat != null) {
                        return c.plot.formatDate(a0, aM.timeformat, aM.monthNames)
                    }
                    var aW = aY.tickSize[0] * aJ[aY.tickSize[1]];
                    var aX = aY.max - aY.min;
                    var aZ = (aM.twelveHourClock) ? " %p" : "";
                    if (aW < aJ.minute) {
                        fmt = "%h:%M:%S" + aZ
                    } else {
                        if (aW < aJ.day) {
                            if (aX < 2 * aJ.day) {
                                fmt = "%h:%M" + aZ
                            } else {
                                fmt = "%b %d %h:%M" + aZ
                            }
                        } else {
                            if (aW < aJ.month) {
                                fmt = "%b %d"
                            } else {
                                if (aW < aJ.year) {
                                    if (aX < aJ.year) {
                                        fmt = "%b"
                                    } else {
                                        fmt = "%b %y"
                                    }
                                } else {
                                    fmt = "%y"
                                }
                            }
                        }
                    }
                    return c.plot.formatDate(a0, fmt, aM.monthNames)
                }
            } else {
                var aU = aM.tickDecimals;
                var aP = -Math.floor(Math.log(aT) / Math.LN10);
                if (aU != null && aP > aU) {
                    aP = aU
                }
                aQ = Math.pow(10, -aP);
                aI = aT / aQ;
                if (aI < 1.5) {
                    aO = 1
                } else {
                    if (aI < 3) {
                        aO = 2;
                        if (aI > 2.25 && (aU == null || aP + 1 <= aU)) {
                            aO = 2.5;
                            ++aP
                        }
                    } else {
                        if (aI < 7.5) {
                            aO = 5
                        } else {
                            aO = 10
                        }
                    }
                }
                aO *= aQ;
                if (aM.minTickSize != null && aO < aM.minTickSize) {
                    aO = aM.minTickSize
                }
                aG.tickDecimals = Math.max(0, aU != null ? aU : aP);
                aG.tickSize = aM.tickSize || aO;
                aB = function (aX) {
                    var aZ = [];
                    var a0 = a(aX.min, aX.tickSize),
                        aW = 0,
                        aV = Number.NaN,
                        aY;
                    do {
                        aY = aV;
                        aV = a0 + aW * aX.tickSize;
                        aZ.push(aV);++aW
                    } while (aV < aX.max && aV != aY);
                    return aZ
                };
                aR = function (aV, aW) {
                    return aV.toFixed(aW.tickDecimals)
                }
            }
            if (aM.alignTicksWithAxis != null) {
                var aF = (aG.direction == "x" ? p : aw)[aM.alignTicksWithAxis - 1];
                if (aF && aF.used && aF != aG) {
                    var aL = aB(aG);
                    if (aL.length > 0) {
                        if (aM.min == null) {
                            aG.min = Math.min(aG.min, aL[0])
                        }
                        if (aM.max == null && aL.length > 1) {
                            aG.max = Math.max(aG.max, aL[aL.length - 1])
                        }
                    }
                    aB = function (aX) {
                        var aY = [],
                            aV, aW;
                        for (aW = 0; aW < aF.ticks.length; ++aW) {
                            aV = (aF.ticks[aW].v - aF.min) / (aF.max - aF.min);
                            aV = aX.min + aV * (aX.max - aX.min);
                            aY.push(aV)
                        }
                        return aY
                    };
                    if (aG.mode != "time" && aM.tickDecimals == null) {
                        var aE = Math.max(0, -Math.floor(Math.log(aT) / Math.LN10) + 1),
                            aD = aB(aG);
                        if (!(aD.length > 1 && /\..*0$/.test((aD[1] - aD[0]).toFixed(aE)))) {
                            aG.tickDecimals = aE
                        }
                    }
                }
            }
            aG.tickGenerator = aB;
            if (c.isFunction(aM.tickFormatter)) {
                aG.tickFormatter = function (aV, aW) {
                    return "" + aM.tickFormatter(aV, aW)
                }
            } else {
                aG.tickFormatter = aR
            }
        }
        function P(aF) {
            var aH = aF.options.ticks,
                aG = [];
            if (aH == null || (typeof aH == "number" && aH > 0)) {
                aG = aF.tickGenerator(aF)
            } else {
                if (aH) {
                    if (c.isFunction(aH)) {
                        aG = aH({
                            min: aF.min,
                            max: aF.max
                        })
                    } else {
                        aG = aH
                    }
                }
            }
            var aE, aB;
            aF.ticks = [];
            for (aE = 0; aE < aG.length; ++aE) {
                var aC = null;
                var aD = aG[aE];
                if (typeof aD == "object") {
                    aB = +aD[0];
                    if (aD.length > 1) {
                        aC = aD[1]
                    }
                } else {
                    aB = +aD
                }
                if (aC == null) {
                    aC = aF.tickFormatter(aB, aF)
                }
                if (!isNaN(aB)) {
                    aF.ticks.push({
                        v: aB,
                        label: aC
                    })
                }
            }
        }
        function ap(aB, aC) {
            if (aB.options.autoscaleMargin && aC.length > 0) {
                if (aB.options.min == null) {
                    aB.min = Math.min(aB.min, aC[0].v)
                }
                if (aB.options.max == null && aC.length > 1) {
                    aB.max = Math.max(aB.max, aC[aC.length - 1].v)
                }
            }
        }
        function W() {
            H.clearRect(0, 0, G, I);
            var aC = O.grid;
            if (aC.show && aC.backgroundColor) {
                N()
            }
            if (aC.show && !aC.aboveData) {
                ac()
            }
            for (var aB = 0; aB < Q.length; ++aB) {
                an(ak.drawSeries, [H, Q[aB]]);
                d(Q[aB])
            }
            an(ak.draw, [H]);
            if (aC.show && aC.aboveData) {
                ac()
            }
        }
        function D(aB, aI) {
            var aE, aH, aG, aD, aF = m();
            for (i = 0; i < aF.length; ++i) {
                aE = aF[i];
                if (aE.direction == aI) {
                    aD = aI + aE.n + "axis";
                    if (!aB[aD] && aE.n == 1) {
                        aD = aI + "axis"
                    }
                    if (aB[aD]) {
                        aH = aB[aD].from;
                        aG = aB[aD].to;
                        break
                    }
                }
            }
            if (!aB[aD]) {
                aE = aI == "x" ? p[0] : aw[0];
                aH = aB[aI + "1"];
                aG = aB[aI + "2"]
            }
            if (aH != null && aG != null && aH > aG) {
                var aC = aH;
                aH = aG;
                aG = aC
            }
            return {
                from: aH,
                to: aG,
                axis: aE
            }
        }
        function N() {
            H.save();
            H.translate(q.left, q.top);
            H.fillStyle = am(O.grid.backgroundColor, w, 0, "rgba(255, 255, 255, 0)");
            H.fillRect(0, 0, h, w);
            H.restore()
        }
        function ac() {
            var aF;
            H.save();
            H.translate(q.left, q.top);
            var aH = O.grid.markings;
            if (aH) {
                if (c.isFunction(aH)) {
                    var aK = aq.getAxes();
                    aK.xmin = aK.xaxis.min;
                    aK.xmax = aK.xaxis.max;
                    aK.ymin = aK.yaxis.min;
                    aK.ymax = aK.yaxis.max;
                    aH = aH(aK)
                }
                for (aF = 0; aF < aH.length; ++aF) {
                    var aD = aH[aF],
                        aC = D(aD, "x"),
                        aI = D(aD, "y");
                    if (aC.from == null) {
                        aC.from = aC.axis.min
                    }
                    if (aC.to == null) {
                        aC.to = aC.axis.max
                    }
                    if (aI.from == null) {
                        aI.from = aI.axis.min
                    }
                    if (aI.to == null) {
                        aI.to = aI.axis.max
                    }
                    if (aC.to < aC.axis.min || aC.from > aC.axis.max || aI.to < aI.axis.min || aI.from > aI.axis.max) {
                        continue
                    }
                    aC.from = Math.max(aC.from, aC.axis.min);
                    aC.to = Math.min(aC.to, aC.axis.max);
                    aI.from = Math.max(aI.from, aI.axis.min);
                    aI.to = Math.min(aI.to, aI.axis.max);
                    if (aC.from == aC.to && aI.from == aI.to) {
                        continue
                    }
                    aC.from = aC.axis.p2c(aC.from);
                    aC.to = aC.axis.p2c(aC.to);
                    aI.from = aI.axis.p2c(aI.from);
                    aI.to = aI.axis.p2c(aI.to);
                    if (aC.from == aC.to || aI.from == aI.to) {
                        H.beginPath();
                        H.strokeStyle = aD.color || O.grid.markingsColor;
                        H.lineWidth = aD.lineWidth || O.grid.markingsLineWidth;
                        H.moveTo(aC.from, aI.from);
                        H.lineTo(aC.to, aI.to);
                        H.stroke()
                    } else {
                        H.fillStyle = aD.color || O.grid.markingsColor;
                        H.fillRect(aC.from, aI.to, aC.to - aC.from, aI.from - aI.to)
                    }
                }
            }
            var aK = m(),
                aM = O.grid.borderWidth;
            for (var aE = 0; aE < aK.length; ++aE) {
                var aB = aK[aE],
                    aG = aB.box,
                    aQ = aB.tickLength,
                    aN, aL, aP, aJ;
                if (!aB.show || aB.ticks.length == 0) {
                    continue
                }
                H.strokeStyle = aB.options.tickColor || c.color.parse(aB.options.color).scale("a", 0.22).toString();
                H.lineWidth = 1;
                if (aB.direction == "x") {
                    aN = 0;
                    if (aQ == "full") {
                        aL = (aB.position == "top" ? 0 : w)
                    } else {
                        aL = aG.top - q.top + (aB.position == "top" ? aG.height : 0)
                    }
                } else {
                    aL = 0;
                    if (aQ == "full") {
                        aN = (aB.position == "left" ? 0 : h)
                    } else {
                        aN = aG.left - q.left + (aB.position == "left" ? aG.width : 0)
                    }
                }
                if (!aB.innermost) {
                    H.beginPath();
                    aP = aJ = 0;
                    if (aB.direction == "x") {
                        aP = h
                    } else {
                        aJ = w
                    }
                    if (H.lineWidth == 1) {
                        aN = Math.floor(aN) + 0.5;
                        aL = Math.floor(aL) + 0.5
                    }
                    H.moveTo(aN, aL);
                    H.lineTo(aN + aP, aL + aJ);
                    H.stroke()
                }
                H.beginPath();
                for (aF = 0; aF < aB.ticks.length; ++aF) {
                    var aO = aB.ticks[aF].v;
                    aP = aJ = 0;
                    if (aO < aB.min || aO > aB.max || (aQ == "full" && aM > 0 && (aO == aB.min || aO == aB.max))) {
                        continue
                    }
                    if (aB.direction == "x") {
                        aN = aB.p2c(aO);
                        aJ = aQ == "full" ? -w : aQ;
                        if (aB.position == "top") {
                            aJ = -aJ
                        }
                    } else {
                        aL = aB.p2c(aO);
                        aP = aQ == "full" ? -h : aQ;
                        if (aB.position == "left") {
                            aP = -aP
                        }
                    }
                    if (H.lineWidth == 1) {
                        if (aB.direction == "x") {
                            aN = Math.floor(aN) + 0.5
                        } else {
                            aL = Math.floor(aL) + 0.5
                        }
                    }
                    H.moveTo(aN, aL);
                    H.lineTo(aN + aP, aL + aJ)
                }
                H.stroke()
            }
            if (aM) {
                H.lineWidth = aM;
                H.strokeStyle = O.grid.borderColor;
                H.strokeRect(-aM / 2, -aM / 2, h + aM, w + aM)
            }
            H.restore()
        }
        function k() {
            av.find(".tickLabels").remove();
            var aG = ['<div class="tickLabels" style="font-size:smaller">'];
            var aJ = m();
            for (var aD = 0; aD < aJ.length; ++aD) {
                var aC = aJ[aD],
                    aF = aC.box;
                if (!aC.show) {
                    continue
                }
                aG.push('<div class="' + aC.direction + "Axis " + aC.direction + aC.n + 'Axis" style="color:' + aC.options.color + '">');
                for (var aE = 0; aE < aC.ticks.length; ++aE) {
                    var aH = aC.ticks[aE];
                    if (!aH.label || aH.v < aC.min || aH.v > aC.max) {
                        continue
                    }
                    var aK = {},
                        aI;
                    if (aC.direction == "x") {
                        aI = "center";
                        aK.left = Math.round(q.left + aC.p2c(aH.v) - aC.labelWidth / 2);
                        if (aC.position == "bottom") {
                            aK.top = aF.top + aF.padding
                        } else {
                            aK.bottom = I - (aF.top + aF.height - aF.padding)
                        }
                    } else {
                        aK.top = Math.round(q.top + aC.p2c(aH.v) - aC.labelHeight / 2);
                        if (aC.position == "left") {
                            aK.right = G - (aF.left + aF.width - aF.padding);
                            aI = "right"
                        } else {
                            aK.left = aF.left + aF.padding;
                            aI = "left"
                        }
                    }
                    aK.width = aC.labelWidth;
                    var aB = ["position:absolute", "text-align:" + aI];
                    for (var aL in aK) {
                        aB.push(aL + ":" + aK[aL] + "px")
                    }
                    aG.push('<div class="tickLabel" style="' + aB.join(";") + '">' + aH.label + "</div>")
                }
                aG.push("</div>")
            }
            aG.push("</div>");
            av.append(aG.join(""))
        }
        function d(aB) {
            if (aB.lines.show) {
                at(aB)
            }
            if (aB.bars.show) {
                e(aB)
            }
            if (aB.points.show) {
                ao(aB)
            }
        }
        function at(aE) {
            function aD(aP, aQ, aI, aU, aT) {
                var aV = aP.points,
                    aJ = aP.pointsize,
                    aN = null,
                    aM = null;
                H.beginPath();
                for (var aO = aJ; aO < aV.length; aO += aJ) {
                    var aL = aV[aO - aJ],
                        aS = aV[aO - aJ + 1],
                        aK = aV[aO],
                        aR = aV[aO + 1];
                    if (aL == null || aK == null) {
                        continue
                    }
                    if (aS <= aR && aS < aT.min) {
                        if (aR < aT.min) {
                            continue
                        }
                        aL = (aT.min - aS) / (aR - aS) * (aK - aL) + aL;
                        aS = aT.min
                    } else {
                        if (aR <= aS && aR < aT.min) {
                            if (aS < aT.min) {
                                continue
                            }
                            aK = (aT.min - aS) / (aR - aS) * (aK - aL) + aL;
                            aR = aT.min
                        }
                    }
                    if (aS >= aR && aS > aT.max) {
                        if (aR > aT.max) {
                            continue
                        }
                        aL = (aT.max - aS) / (aR - aS) * (aK - aL) + aL;
                        aS = aT.max
                    } else {
                        if (aR >= aS && aR > aT.max) {
                            if (aS > aT.max) {
                                continue
                            }
                            aK = (aT.max - aS) / (aR - aS) * (aK - aL) + aL;
                            aR = aT.max
                        }
                    }
                    if (aL <= aK && aL < aU.min) {
                        if (aK < aU.min) {
                            continue
                        }
                        aS = (aU.min - aL) / (aK - aL) * (aR - aS) + aS;
                        aL = aU.min
                    } else {
                        if (aK <= aL && aK < aU.min) {
                            if (aL < aU.min) {
                                continue
                            }
                            aR = (aU.min - aL) / (aK - aL) * (aR - aS) + aS;
                            aK = aU.min
                        }
                    }
                    if (aL >= aK && aL > aU.max) {
                        if (aK > aU.max) {
                            continue
                        }
                        aS = (aU.max - aL) / (aK - aL) * (aR - aS) + aS;
                        aL = aU.max
                    } else {
                        if (aK >= aL && aK > aU.max) {
                            if (aL > aU.max) {
                                continue
                            }
                            aR = (aU.max - aL) / (aK - aL) * (aR - aS) + aS;
                            aK = aU.max
                        }
                    }
                    if (aL != aN || aS != aM) {
                        H.moveTo(aU.p2c(aL) + aQ, aT.p2c(aS) + aI)
                    }
                    aN = aK;
                    aM = aR;
                    H.lineTo(aU.p2c(aK) + aQ, aT.p2c(aR) + aI)
                }
                H.stroke()
            }
            function aF(aI, aQ, aP) {
                var aW = aI.points,
                    aV = aI.pointsize,
                    aN = Math.min(Math.max(0, aP.min), aP.max),
                    aX = 0,
                    aU, aT = false,
                    aM = 1,
                    aL = 0,
                    aR = 0;
                while (true) {
                    if (aV > 0 && aX > aW.length + aV) {
                        break
                    }
                    aX += aV;
                    var aZ = aW[aX - aV],
                        aK = aW[aX - aV + aM],
                        aY = aW[aX],
                        aJ = aW[aX + aM];
                    if (aT) {
                        if (aV > 0 && aZ != null && aY == null) {
                            aR = aX;
                            aV = -aV;
                            aM = 2;
                            continue
                        }
                        if (aV < 0 && aX == aL + aV) {
                            H.fill();
                            aT = false;
                            aV = -aV;
                            aM = 1;
                            aX = aL = aR + aV;
                            continue
                        }
                    }
                    if (aZ == null || aY == null) {
                        continue
                    }
                    if (aZ <= aY && aZ < aQ.min) {
                        if (aY < aQ.min) {
                            continue
                        }
                        aK = (aQ.min - aZ) / (aY - aZ) * (aJ - aK) + aK;
                        aZ = aQ.min
                    } else {
                        if (aY <= aZ && aY < aQ.min) {
                            if (aZ < aQ.min) {
                                continue
                            }
                            aJ = (aQ.min - aZ) / (aY - aZ) * (aJ - aK) + aK;
                            aY = aQ.min
                        }
                    }
                    if (aZ >= aY && aZ > aQ.max) {
                        if (aY > aQ.max) {
                            continue
                        }
                        aK = (aQ.max - aZ) / (aY - aZ) * (aJ - aK) + aK;
                        aZ = aQ.max
                    } else {
                        if (aY >= aZ && aY > aQ.max) {
                            if (aZ > aQ.max) {
                                continue
                            }
                            aJ = (aQ.max - aZ) / (aY - aZ) * (aJ - aK) + aK;
                            aY = aQ.max
                        }
                    }
                    if (!aT) {
                        H.beginPath();
                        H.moveTo(aQ.p2c(aZ), aP.p2c(aN));
                        aT = true
                    }
                    if (aK >= aP.max && aJ >= aP.max) {
                        H.lineTo(aQ.p2c(aZ), aP.p2c(aP.max));
                        H.lineTo(aQ.p2c(aY), aP.p2c(aP.max));
                        continue
                    } else {
                        if (aK <= aP.min && aJ <= aP.min) {
                            H.lineTo(aQ.p2c(aZ), aP.p2c(aP.min));
                            H.lineTo(aQ.p2c(aY), aP.p2c(aP.min));
                            continue
                        }
                    }
                    var aO = aZ,
                        aS = aY;
                    if (aK <= aJ && aK < aP.min && aJ >= aP.min) {
                        aZ = (aP.min - aK) / (aJ - aK) * (aY - aZ) + aZ;
                        aK = aP.min
                    } else {
                        if (aJ <= aK && aJ < aP.min && aK >= aP.min) {
                            aY = (aP.min - aK) / (aJ - aK) * (aY - aZ) + aZ;
                            aJ = aP.min
                        }
                    }
                    if (aK >= aJ && aK > aP.max && aJ <= aP.max) {
                        aZ = (aP.max - aK) / (aJ - aK) * (aY - aZ) + aZ;
                        aK = aP.max
                    } else {
                        if (aJ >= aK && aJ > aP.max && aK <= aP.max) {
                            aY = (aP.max - aK) / (aJ - aK) * (aY - aZ) + aZ;
                            aJ = aP.max
                        }
                    }
                    if (aZ != aO) {
                        H.lineTo(aQ.p2c(aO), aP.p2c(aK))
                    }
                    H.lineTo(aQ.p2c(aZ), aP.p2c(aK));
                    H.lineTo(aQ.p2c(aY), aP.p2c(aJ));
                    if (aY != aS) {
                        H.lineTo(aQ.p2c(aY), aP.p2c(aJ));
                        H.lineTo(aQ.p2c(aS), aP.p2c(aJ))
                    }
                }
            }
            H.save();
            H.translate(q.left, q.top);
            H.lineJoin = "round";
            var aG = aE.lines.lineWidth,
                aB = aE.shadowSize;
            if (aG > 0 && aB > 0) {
                H.lineWidth = aB;
                H.strokeStyle = "rgba(0,0,0,0.1)";
                var aH = Math.PI / 18;
                aD(aE.datapoints, Math.sin(aH) * (aG / 2 + aB / 2), Math.cos(aH) * (aG / 2 + aB / 2), aE.xaxis, aE.yaxis);
                H.lineWidth = aB / 2;
                aD(aE.datapoints, Math.sin(aH) * (aG / 2 + aB / 4), Math.cos(aH) * (aG / 2 + aB / 4), aE.xaxis, aE.yaxis)
            }
            H.lineWidth = aG;
            H.strokeStyle = aE.color;
            var aC = ae(aE.lines, aE.color, 0, w);
            if (aC) {
                H.fillStyle = aC;
                aF(aE.datapoints, aE.xaxis, aE.yaxis)
            }
            if (aG > 0) {
                aD(aE.datapoints, 0, 0, aE.xaxis, aE.yaxis)
            }
            H.restore()
        }
        function ao(aE) {
            function aH(aN, aM, aU, aK, aS, aT, aQ, aJ) {
                var aR = aN.points,
                    aI = aN.pointsize;
                for (var aL = 0; aL < aR.length; aL += aI) {
                    var aP = aR[aL],
                        aO = aR[aL + 1];
                    if (aP == null || aP < aT.min || aP > aT.max || aO < aQ.min || aO > aQ.max) {
                        continue
                    }
                    H.beginPath();
                    aP = aT.p2c(aP);
                    aO = aQ.p2c(aO) + aK;
                    if (aJ == "circle") {
                        H.arc(aP, aO, aM, 0, aS ? Math.PI : Math.PI * 2, false)
                    } else {
                        aJ(H, aP, aO, aM, aS)
                    }
                    H.closePath();
                    if (aU) {
                        H.fillStyle = aU;
                        H.fill()
                    }
                    H.stroke()
                }
            }
            H.save();
            H.translate(q.left, q.top);
            var aG = aE.points.lineWidth,
                aC = aE.shadowSize,
                aB = aE.points.radius,
                aF = aE.points.symbol;
            if (aG > 0 && aC > 0) {
                var aD = aC / 2;
                H.lineWidth = aD;
                H.strokeStyle = "rgba(0,0,0,0.1)";
                aH(aE.datapoints, aB, null, aD + aD / 2, true, aE.xaxis, aE.yaxis, aF);
                H.strokeStyle = "rgba(0,0,0,0.2)";
                aH(aE.datapoints, aB, null, aD / 2, true, aE.xaxis, aE.yaxis, aF)
            }
            H.lineWidth = aG;
            H.strokeStyle = aE.color;
            aH(aE.datapoints, aB, ae(aE.points, aE.color), 0, false, aE.xaxis, aE.yaxis, aF);
            H.restore()
        }
        function E(aN, aM, aV, aI, aQ, aF, aD, aL, aK, aU, aR, aC) {
            var aE, aT, aJ, aP, aG, aB, aO, aH, aS;
            if (aR) {
                aH = aB = aO = true;
                aG = false;
                aE = aV;
                aT = aN;
                aP = aM + aI;
                aJ = aM + aQ;
                if (aT < aE) {
                    aS = aT;
                    aT = aE;
                    aE = aS;
                    aG = true;
                    aB = false
                }
            } else {
                aG = aB = aO = true;
                aH = false;
                aE = aN + aI;
                aT = aN + aQ;
                aJ = aV;
                aP = aM;
                if (aP < aJ) {
                    aS = aP;
                    aP = aJ;
                    aJ = aS;
                    aH = true;
                    aO = false
                }
            }
            if (aT < aL.min || aE > aL.max || aP < aK.min || aJ > aK.max) {
                return
            }
            if (aE < aL.min) {
                aE = aL.min;
                aG = false
            }
            if (aT > aL.max) {
                aT = aL.max;
                aB = false
            }
            if (aJ < aK.min) {
                aJ = aK.min;
                aH = false
            }
            if (aP > aK.max) {
                aP = aK.max;
                aO = false
            }
            aE = aL.p2c(aE);
            aJ = aK.p2c(aJ);
            aT = aL.p2c(aT);
            aP = aK.p2c(aP);
            if (aD) {
                aU.beginPath();
                aU.moveTo(aE, aJ);
                aU.lineTo(aE, aP);
                aU.lineTo(aT, aP);
                aU.lineTo(aT, aJ);
                aU.fillStyle = aD(aJ, aP);
                aU.fill()
            }
            if (aC > 0 && (aG || aB || aO || aH)) {
                aU.beginPath();
                aU.moveTo(aE, aJ + aF);
                if (aG) {
                    aU.lineTo(aE, aP + aF)
                } else {
                    aU.moveTo(aE, aP + aF)
                }
                if (aO) {
                    aU.lineTo(aT, aP + aF)
                } else {
                    aU.moveTo(aT, aP + aF)
                }
                if (aB) {
                    aU.lineTo(aT, aJ + aF)
                } else {
                    aU.moveTo(aT, aJ + aF)
                }
                if (aH) {
                    aU.lineTo(aE, aJ + aF)
                } else {
                    aU.moveTo(aE, aJ + aF)
                }
                aU.stroke()
            }
        }
        function e(aD) {
            function aC(aJ, aI, aL, aG, aK, aN, aM) {
                var aO = aJ.points,
                    aF = aJ.pointsize;
                for (var aH = 0; aH < aO.length; aH += aF) {
                    if (aO[aH] == null) {
                        continue
                    }
                    E(aO[aH], aO[aH + 1], aO[aH + 2], aI, aL, aG, aK, aN, aM, H, aD.bars.horizontal, aD.bars.lineWidth)
                }
            }
            H.save();
            H.translate(q.left, q.top);
            H.lineWidth = aD.bars.lineWidth;
            H.strokeStyle = aD.color;
            var aB = aD.bars.align == "left" ? 0 : -aD.bars.barWidth / 2;
            var aE = aD.bars.fill ?
            function (aF, aG) {
                return ae(aD.bars, aD.color, aF, aG)
            } : null;
            aC(aD.datapoints, aB, aB + aD.bars.barWidth, 0, aE, aD.xaxis, aD.yaxis);
            H.restore()
        }
        function ae(aD, aB, aC, aF) {
            var aE = aD.fill;
            if (!aE) {
                return null
            }
            if (aD.fillColor) {
                return am(aD.fillColor, aC, aF, aB)
            }
            var aG = c.color.parse(aB);
            aG.a = typeof aE == "number" ? aE : 0.4;
            aG.normalize();
            return aG.toString()
        }
        function o() {
            av.find(".legend").remove();
            if (!O.legend.show) {
                return
            }
            var aH = [],
                aF = false,
                aN = O.legend.labelFormatter,
                aM, aJ;
            for (var aE = 0; aE < Q.length; ++aE) {
                aM = Q[aE];
                aJ = aM.label;
                if (!aJ) {
                    continue
                }
                if (aE % O.legend.noColumns == 0) {
                    if (aF) {
                        aH.push("</tr>")
                    }
                    aH.push("<tr>");
                    aF = true
                }
                if (aN) {
                    aJ = aN(aJ, aM)
                }
                aH.push('<td class="legendColorBox"><div style="border:1px solid ' + O.legend.labelBoxBorderColor + ';padding:1px"><div style="width:4px;height:0;border:5px solid ' + aM.color + ';overflow:hidden"></div></div></td><td class="legendLabel">' + aJ + "</td>")
            }
            if (aF) {
                aH.push("</tr>")
            }
            if (aH.length == 0) {
                return
            }
            var aL = '<table style="font-size:smaller;color:' + O.grid.color + '">' + aH.join("") + "</table>";
            if (O.legend.container != null) {
                c(O.legend.container).html(aL)
            } else {
                var aI = "",
                    aC = O.legend.position,
                    aD = O.legend.margin;
                if (aD[0] == null) {
                    aD = [aD, aD]
                }
                if (aC.charAt(0) == "n") {
                    aI += "top:" + (aD[1] + q.top) + "px;"
                } else {
                    if (aC.charAt(0) == "s") {
                        aI += "bottom:" + (aD[1] + q.bottom) + "px;"
                    }
                }
                if (aC.charAt(1) == "e") {
                    aI += "right:" + (aD[0] + q.right) + "px;"
                } else {
                    if (aC.charAt(1) == "w") {
                        aI += "left:" + (aD[0] + q.left) + "px;"
                    }
                }
                var aK = c('<div class="legend">' + aL.replace('style="', 'style="position:absolute;' + aI + ";") + "</div>").appendTo(av);
                if (O.legend.backgroundOpacity != 0) {
                    var aG = O.legend.backgroundColor;
                    if (aG == null) {
                        aG = O.grid.backgroundColor;
                        if (aG && typeof aG == "string") {
                            aG = c.color.parse(aG)
                        } else {
                            aG = c.color.extract(aK, "background-color")
                        }
                        aG.a = 1;
                        aG = aG.toString()
                    }
                    var aB = aK.children();
                    c('<div style="position:absolute;width:' + aB.width() + "px;height:" + aB.height() + "px;" + aI + "background-color:" + aG + ';"> </div>').prependTo(aK).css("opacity", O.legend.backgroundOpacity)
                }
            }
        }
        var ab = [],
            M = null;

        function K(aI, aG, aD) {
            var aO = O.grid.mouseActiveRadius,
                a0 = aO * aO + 1,
                aY = null,
                aR = false,
                aW, aU;
            for (aW = Q.length - 1; aW >= 0; --aW) {
                if (!aD(Q[aW])) {
                    continue
                }
                var aP = Q[aW],
                    aH = aP.xaxis,
                    aF = aP.yaxis,
                    aV = aP.datapoints.points,
                    aT = aP.datapoints.pointsize,
                    aQ = aH.c2p(aI),
                    aN = aF.c2p(aG),
                    aC = aO / aH.scale,
                    aB = aO / aF.scale;
                if (aH.options.inverseTransform) {
                    aC = Number.MAX_VALUE
                }
                if (aF.options.inverseTransform) {
                    aB = Number.MAX_VALUE
                }
                if (aP.lines.show || aP.points.show) {
                    for (aU = 0; aU < aV.length; aU += aT) {
                        var aK = aV[aU],
                            aJ = aV[aU + 1];
                        if (aK == null) {
                            continue
                        }
                        if (aK - aQ > aC || aK - aQ < -aC || aJ - aN > aB || aJ - aN < -aB) {
                            continue
                        }
                        var aM = Math.abs(aH.p2c(aK) - aI),
                            aL = Math.abs(aF.p2c(aJ) - aG),
                            aS = aM * aM + aL * aL;
                        if (aS < a0) {
                            a0 = aS;
                            aY = [aW, aU / aT]
                        }
                    }
                }
                if (aP.bars.show && !aY) {
                    var aE = aP.bars.align == "left" ? 0 : -aP.bars.barWidth / 2,
                        aX = aE + aP.bars.barWidth;
                    for (aU = 0; aU < aV.length; aU += aT) {
                        var aK = aV[aU],
                            aJ = aV[aU + 1],
                            aZ = aV[aU + 2];
                        if (aK == null) {
                            continue
                        }
                        if (Q[aW].bars.horizontal ? (aQ <= Math.max(aZ, aK) && aQ >= Math.min(aZ, aK) && aN >= aJ + aE && aN <= aJ + aX) : (aQ >= aK + aE && aQ <= aK + aX && aN >= Math.min(aZ, aJ) && aN <= Math.max(aZ, aJ))) {
                            aY = [aW, aU / aT]
                        }
                    }
                }
            }
            if (aY) {
                aW = aY[0];
                aU = aY[1];
                aT = Q[aW].datapoints.pointsize;
                return {
                    datapoint: Q[aW].datapoints.points.slice(aU * aT, (aU + 1) * aT),
                    dataIndex: aU,
                    series: Q[aW],
                    seriesIndex: aW
                }
            }
            return null
        }
        function aa(aB) {
            if (O.grid.hoverable) {
                u("plothover", aB, function (aC) {
                    return aC.hoverable != false
                })
            }
        }
        function l(aB) {
            if (O.grid.hoverable) {
                u("plothover", aB, function (aC) {
                    return false
                })
            }
        }
        function R(aB) {
            u("plotclick", aB, function (aC) {
                return aC.clickable != false
            })
        }
        function u(aC, aB, aD) {
            var aE = y.offset(),
                aH = aB.pageX - aE.left - q.left,
                aF = aB.pageY - aE.top - q.top,
                aJ = C({
                    left: aH,
                    top: aF
                });
            aJ.pageX = aB.pageX;
            aJ.pageY = aB.pageY;
            var aK = K(aH, aF, aD);
            if (aK) {
                aK.pageX = parseInt(aK.series.xaxis.p2c(aK.datapoint[0]) + aE.left + q.left);
                aK.pageY = parseInt(aK.series.yaxis.p2c(aK.datapoint[1]) + aE.top + q.top)
            }
            if (O.grid.autoHighlight) {
                for (var aG = 0; aG < ab.length; ++aG) {
                    var aI = ab[aG];
                    if (aI.auto == aC && !(aK && aI.series == aK.series && aI.point[0] == aK.datapoint[0] && aI.point[1] == aK.datapoint[1])) {
                        T(aI.series, aI.point)
                    }
                }
                if (aK) {
                    x(aK.series, aK.datapoint, aC)
                }
            }
            av.trigger(aC, [aJ, aK])
        }
        function f() {
            if (!M) {
                M = setTimeout(s, 30)
            }
        }
        function s() {
            M = null;
            A.save();
            A.clearRect(0, 0, G, I);
            A.translate(q.left, q.top);
            var aC, aB;
            for (aC = 0; aC < ab.length; ++aC) {
                aB = ab[aC];
                if (aB.series.bars.show) {
                    v(aB.series, aB.point)
                } else {
                    ay(aB.series, aB.point)
                }
            }
            A.restore();
            an(ak.drawOverlay, [A])
        }
        function x(aD, aB, aF) {
            if (typeof aD == "number") {
                aD = Q[aD]
            }
            if (typeof aB == "number") {
                var aE = aD.datapoints.pointsize;
                aB = aD.datapoints.points.slice(aE * aB, aE * (aB + 1))
            }
            var aC = al(aD, aB);
            if (aC == -1) {
                ab.push({
                    series: aD,
                    point: aB,
                    auto: aF
                });
                f()
            } else {
                if (!aF) {
                    ab[aC].auto = false
                }
            }
        }
        function T(aD, aB) {
            if (aD == null && aB == null) {
                ab = [];
                f()
            }
            if (typeof aD == "number") {
                aD = Q[aD]
            }
            if (typeof aB == "number") {
                aB = aD.data[aB]
            }
            var aC = al(aD, aB);
            if (aC != -1) {
                ab.splice(aC, 1);
                f()
            }
        }
        function al(aD, aE) {
            for (var aB = 0; aB < ab.length; ++aB) {
                var aC = ab[aB];
                if (aC.series == aD && aC.point[0] == aE[0] && aC.point[1] == aE[1]) {
                    return aB
                }
            }
            return -1
        }
        function ay(aE, aD) {
            var aC = aD[0],
                aI = aD[1],
                aH = aE.xaxis,
                aG = aE.yaxis;
            if (aC < aH.min || aC > aH.max || aI < aG.min || aI > aG.max) {
                return
            }
            var aF = aE.points.radius + aE.points.lineWidth / 2;
            A.lineWidth = aF;
            A.strokeStyle = c.color.parse(aE.color).scale("a", 0.5).toString();
            var aB = 1.5 * aF,
                aC = aH.p2c(aC),
                aI = aG.p2c(aI);
            A.beginPath();
            if (aE.points.symbol == "circle") {
                A.arc(aC, aI, aB, 0, 2 * Math.PI, false)
            } else {
                aE.points.symbol(A, aC, aI, aB, false)
            }
            A.closePath();
            A.stroke()
        }
        function v(aE, aB) {
            A.lineWidth = aE.bars.lineWidth;
            A.strokeStyle = c.color.parse(aE.color).scale("a", 0.5).toString();
            var aD = c.color.parse(aE.color).scale("a", 0.5).toString();
            var aC = aE.bars.align == "left" ? 0 : -aE.bars.barWidth / 2;
            E(aB[0], aB[1], aB[2] || 0, aC, aC + aE.bars.barWidth, 0, function () {
                return aD
            }, aE.xaxis, aE.yaxis, A, aE.bars.horizontal, aE.bars.lineWidth)
        }
        function am(aJ, aB, aH, aC) {
            if (typeof aJ == "string") {
                return aJ
            } else {
                var aI = H.createLinearGradient(0, aH, 0, aB);
                for (var aE = 0, aD = aJ.colors.length; aE < aD; ++aE) {
                    var aF = aJ.colors[aE];
                    if (typeof aF != "string") {
                        var aG = c.color.parse(aC);
                        if (aF.brightness != null) {
                            aG = aG.scale("rgb", aF.brightness)
                        }
                        if (aF.opacity != null) {
                            aG.a *= aF.opacity
                        }
                        aF = aG.toString()
                    }
                    aI.addColorStop(aE / (aD - 1), aF)
                }
                return aI
            }
        }
    }
    c.plot = function (g, e, d) {
        var f = new b(c(g), e, d, c.plot.plugins);
        return f
    };
    c.plot.version = "0.7";
    c.plot.plugins = [];
    c.plot.formatDate = function (l, f, h) {
        var o = function (d) {
                d = "" + d;
                return d.length == 1 ? "0" + d : d
            };
        var e = [];
        var p = false,
            j = false;
        var n = l.getUTCHours();
        var k = n < 12;
        if (h == null) {
            h = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
        }
        if (f.search(/%p|%P/) != -1) {
            if (n > 12) {
                n = n - 12
            } else {
                if (n == 0) {
                    n = 12
                }
            }
        }
        for (var g = 0; g < f.length; ++g) {
            var m = f.charAt(g);
            if (p) {
                switch (m) {
                case "h":
                    m = "" + n;
                    break;
                case "H":
                    m = o(n);
                    break;
                case "M":
                    m = o(l.getUTCMinutes());
                    break;
                case "S":
                    m = o(l.getUTCSeconds());
                    break;
                case "d":
                    m = "" + l.getUTCDate();
                    break;
                case "m":
                    m = "" + (l.getUTCMonth() + 1);
                    break;
                case "y":
                    m = "" + l.getUTCFullYear();
                    break;
                case "b":
                    m = "" + h[l.getUTCMonth()];
                    break;
                case "p":
                    m = (k) ? ("am") : ("pm");
                    break;
                case "P":
                    m = (k) ? ("AM") : ("PM");
                    break;
                case "0":
                    m = "";
                    j = true;
                    break
                }
                if (m && j) {
                    m = o(m);
                    j = false
                }
                e.push(m);
                if (!j) {
                    p = false
                }
            } else {
                if (m == "%") {
                    p = true
                } else {
                    e.push(m)
                }
            }
        }
        return e.join("")
    };

    function a(e, d) {
        return d * Math.floor(e / d)
    }
})(jQuery);
(function (k) {
    k.plot.plugins.push({
        init: function (k) {
            function m(a, c) {
                for (var d = [], b = 0; b < a.length; b++) d[0] = a[b].data[0][c], d[1] = a[b].data[a[b].data.length - 1][c];
                return d
            }
            function q(a, c) {
                var d = a.bars.order,
                    b = c.bars.order;
                return d < b ? -1 : d > b ? 1 : 0
            }
            function n(a, c, d) {
                for (var b = 0; c <= d; c++) b += a[c].bars.barWidth + l * 2;
                return b
            }
            var g, h, o, l, p = 1,
                i = !1;
            k.hooks.processDatapoints.push(function (a, c, d) {
                var b = null;
                if (c.bars != null && c.bars.show && c.bars.order != null) {
                    c.bars.horizontal && (i = !0);
                    var f = i ? a.getPlaceholder().innerHeight() : a.getPlaceholder().innerWidth(),
                        e = i ? m(a.getData(), 1) : m(a.getData(), 0);
                    p = (e[1] - e[0]) / f;
                    a = a.getData();
                    f = [];
                    for (e = 0; e < a.length; e++) a[e].bars.order != null && a[e].bars.show && f.push(a[e]);
                    g = f.sort(q);
                    h = g.length;
                    o = c.bars.lineWidth ? c.bars.lineWidth : 2;
                    l = o * p;
                    if (h >= 2) {
                        for (a = b = 0; a < g.length; ++a) if (c == g[a]) {
                            b = a;
                            break
                        }
                        b += 1;
                        a = a = 0;
                        h % 2 != 0 && (a = g[Math.ceil(h / 2)].bars.barWidth / 2);
                        for (var b = a = b <= Math.ceil(h / 2) ? -1 * n(g, b - 1, Math.floor(h / 2) - 1) - a : n(g, Math.ceil(h / 2), b - 2) + a + l * 2, a = d.pointsize, f = d.points, e = 0, j = i ? 1 : 0; j < f.length; j += a) f[j] += b, c.data[e][3] = f[j], e++;
                        b = f;
                        d.points = b
                    }
                }
                return b
            })
        },
        options: {
            series: {
                bars: {
                    order: null
                }
            }
        },
        name: "orderBars",
        version: "0.2"
    })
})(jQuery);
(function (n) {
    var d = {
        series: {
            pie: {
                show: !1,
                radius: "auto",
                innerRadius: 0,
                startAngle: 1.5,
                tilt: 1,
                offset: {
                    top: 0,
                    left: "auto"
                },
                stroke: {
                    color: "#FFF",
                    width: 1
                },
                label: {
                    show: "auto",
                    formatter: function (d, n) {
                        return '<div style="font-size:x-small;text-align:center;padding:2px;color:' + n.color + ';">' + d + "<br/>" + Math.round(n.percent) + "%</div>"
                    },
                    radius: 1,
                    background: {
                        color: null,
                        opacity: 0
                    },
                    threshold: 0
                },
                combine: {
                    threshold: -1,
                    color: null,
                    label: "Other"
                },
                highlight: {
                    opacity: 0.5
                }
            }
        }
    };
    n.plot.plugins.push({
        init: function (p) {
            function D(a) {
                w || (w = !0, j = a.getCanvas(), q = n(j).parent(), d = a.getOptions(), a.setData(E(a.getData())))
            }
            function E(a) {
                for (var b = 0; b < a.length; ++b) if (typeof a[b].data == "number") a[b].data = [
                    [1, a[b].data]
                ];
                else if (typeof a[b].data == "undefined" || typeof a[b].data[0] == "undefined") {
                    if (typeof a[b].data != "undefined" && typeof a[b].data.label != "undefined") a[b].label = a[b].data.label;
                    a[b].data = [
                        [1, 0]
                    ]
                }
                for (var b = a, h = 0; h < b.length; ++h) {
                    var f = parseFloat(b[h].data[0][1]);
                    f && (o += f)
                }
                for (var h = b = 0, f = d.series.pie.combine.color, e = [], c = 0; c < a.length; ++c) if (a[c].data[0][1] = parseFloat(a[c].data[0][1]), a[c].data[0][1] || (a[c].data[0][1] = 0), a[c].data[0][1] / o <= d.series.pie.combine.threshold) {
                    if (b += a[c].data[0][1], h++, !f) f = a[c].color
                } else e.push({
                    data: [
                        [1, a[c].data[0][1]]
                    ],
                    color: a[c].color,
                    label: a[c].label,
                    angle: a[c].data[0][1] * Math.PI * 2 / o,
                    percent: a[c].data[0][1] / o * 100
                });
                h > 0 && e.push({
                    data: [
                        [1, b]
                    ],
                    color: f,
                    label: d.series.pie.combine.label,
                    angle: b * Math.PI * 2 / o,
                    percent: b / o * 100
                });
                return e
            }
            function F(a, b) {
                function h() {
                    ctx.clearRect(0, 0, j.width, j.height);
                    q.children().filter(".pieLabel, .pieLabelBackground").remove()
                }

                function f() {
                    var a = d.series.pie.radius > 1 ? d.series.pie.radius : m * d.series.pie.radius;
                    if (!(a >= j.width / 2 - 5 || a * d.series.pie.tilt >= j.height / 2 - 15 || a <= 10)) {
                        ctx.save();
                        ctx.translate(5, 15);
                        ctx.globalAlpha = 0.02;
                        ctx.fillStyle = "#000";
                        ctx.translate(l, s);
                        ctx.scale(1, d.series.pie.tilt);
                        for (var b = 1; b <= 10; b++) ctx.beginPath(), ctx.arc(0, 0, a, 0, Math.PI * 2, !1), ctx.fill(), a -= b;
                        ctx.restore()
                    }
                }
                function e() {
                    function a(b, c, d) {
                        if (!(b <= 0)) d ? ctx.fillStyle = c : (ctx.strokeStyle = c, ctx.lineJoin = "round"), ctx.beginPath(), Math.abs(b - Math.PI * 2) > 1.0E-9 ? ctx.moveTo(0, 0) : n.browser.msie && (b -= 1.0E-4), ctx.arc(0, 0, h, e, e + b, !1), ctx.closePath(), e += b, d ? ctx.fill() : ctx.stroke()
                    }
                    function b() {
                        function a(b, c, e) {
                            if (b.data[0][1] != 0) {
                                var f = d.legend.labelFormatter,
                                    g = d.series.pie.label.formatter,
                                    f = f ? f(b.label, b) : b.label;
                                g && (f = g(f, b));
                                g = (c + b.angle + c) / 2;
                                c = l + Math.round(Math.cos(g) * h);
                                g = s + Math.round(Math.sin(g) * h) * d.series.pie.tilt;
                                q.append('<span class="pieLabel" id="pieLabel' + e + '" style="position:absolute;top:' + g + "px;left:" + c + 'px;">' + f + "</span>");
                                e = q.children("#pieLabel" + e);
                                f = g - e.height() / 2;
                                c -= e.width() / 2;
                                e.css("top", f);
                                e.css("left", c);
                                if (0 - f > 0 || 0 - c > 0 || j.height - (f + e.height()) < 0 || j.width - (c + e.width()) < 0) u = !0;
                                if (d.series.pie.label.background.opacity != 0) {
                                    g = d.series.pie.label.background.color;
                                    if (g == null) g = b.color;
                                    n('<div class="pieLabelBackground" style="position:absolute;width:' + e.width() + "px;height:" + e.height() + "px;" + ("top:" + f + "px;left:" + c + "px;") + "background-color:" + g + ';"> </div>').insertBefore(e).css("opacity", d.series.pie.label.background.opacity)
                                }
                            }
                        }
                        for (var f = startAngle, h = d.series.pie.label.radius > 1 ? d.series.pie.label.radius : m * d.series.pie.label.radius, e = 0; e < c.length; ++e) c[e].percent >= d.series.pie.label.threshold * 100 && a(c[e], f, e), f += c[e].angle
                    }
                    startAngle = Math.PI * d.series.pie.startAngle;
                    var h = d.series.pie.radius > 1 ? d.series.pie.radius : m * d.series.pie.radius;
                    ctx.save();
                    ctx.translate(l, s);
                    ctx.scale(1, d.series.pie.tilt);
                    ctx.save();
                    for (var e = startAngle, f = 0; f < c.length; ++f) c[f].startAngle = e, a(c[f].angle, c[f].color, !0);
                    ctx.restore();
                    ctx.save();
                    ctx.lineWidth = d.series.pie.stroke.width;
                    e = startAngle;
                    for (f = 0; f < c.length; ++f) a(c[f].angle, d.series.pie.stroke.color, !1);
                    ctx.restore();
                    z(ctx);
                    d.series.pie.label.show && b();
                    ctx.restore()
                }
                if (q) {
                    ctx = b;
                    v = q.children().filter(".legend").children().width();
                    m = Math.min(j.width, j.height / d.series.pie.tilt) / 2;
                    s = j.height / 2 + d.series.pie.offset.top;
                    l = j.width / 2;
                    d.series.pie.offset.left == "auto" ? d.legend.position.match("w") ? l += v / 2 : l -= v / 2 : l += d.series.pie.offset.left;
                    l < m ? l = m : l > j.width - m && (l = j.width - m);
                    for (var c = a.getData(), k = 0; u && k < A;) u = !1, k > 0 && (m *= G), k += 1, h(), d.series.pie.tilt <= 0.8 && f(), e();
                    k >= A && (h(), q.prepend('<div class="error">Could not draw pie with labels contained inside canvas</div>'));
                    a.setSeries && a.insertLegend && (a.setSeries(c), a.insertLegend())
                }
            }
            function z(a) {
                if (d.series.pie.innerRadius > 0) a.save(), innerRadius = d.series.pie.innerRadius > 1 ? d.series.pie.innerRadius : m * d.series.pie.innerRadius, a.globalCompositeOperation = "destination-out", a.beginPath(), a.fillStyle = d.series.pie.stroke.color, a.arc(0, 0, innerRadius, 0, Math.PI * 2, !1), a.fill(), a.closePath(), a.restore(), a.save(), a.beginPath(), a.strokeStyle = d.series.pie.stroke.color, a.arc(0, 0, innerRadius, 0, Math.PI * 2, !1), a.stroke(), a.closePath(), a.restore()
            }
            function H(a) {
                B("plothover", a)
            }
            function I(a) {
                B("plotclick", a)
            }
            function B(a, b) {
                var h = p.offset(),
                    f = parseInt(b.pageX - h.left);
                a: {
                    for (var h = parseInt(b.pageY - h.top), e = p.getData(), c = p.getOptions(), c = c.series.pie.radius > 1 ? c.series.pie.radius : m * c.series.pie.radius, j = 0; j < e.length; ++j) {
                        var g = e[j];
                        if (g.pie.show) {
                            ctx.save();
                            ctx.beginPath();
                            ctx.moveTo(0, 0);
                            ctx.arc(0, 0, c, g.startAngle, g.startAngle + g.angle, !1);
                            ctx.closePath();
                            x = f - l;
                            y = h - s;
                            if (ctx.isPointInPath) {
                                if (ctx.isPointInPath(f - l, h - s)) {
                                    ctx.restore();
                                    f = {
                                        datapoint: [g.percent, g.data],
                                        dataIndex: 0,
                                        series: g,
                                        seriesIndex: j
                                    };
                                    break a
                                }
                            } else {
                                p1X = c * Math.cos(g.startAngle);
                                p1Y = c * Math.sin(g.startAngle);
                                p2X = c * Math.cos(g.startAngle + g.angle / 4);
                                p2Y = c * Math.sin(g.startAngle + g.angle / 4);
                                p3X = c * Math.cos(g.startAngle + g.angle / 2);
                                p3Y = c * Math.sin(g.startAngle + g.angle / 2);
                                p4X = c * Math.cos(g.startAngle + g.angle / 1.5);
                                p4Y = c * Math.sin(g.startAngle + g.angle / 1.5);
                                p5X = c * Math.cos(g.startAngle + g.angle);
                                p5Y = c * Math.sin(g.startAngle + g.angle);
                                arrPoly = [
                                    [0, 0],
                                    [p1X, p1Y],
                                    [p2X, p2Y],
                                    [p3X, p3Y],
                                    [p4X, p4Y],
                                    [p5X, p5Y]
                                ];
                                arrPoint = [x, y];
                                for (var n = !1, r = -1, o = arrPoly.length, t = o - 1; ++r < o; t = r)(arrPoly[r][1] <= arrPoint[1] && arrPoint[1] < arrPoly[t][1] || arrPoly[t][1] <= arrPoint[1] && arrPoint[1] < arrPoly[r][1]) && arrPoint[0] < (arrPoly[t][0] - arrPoly[r][0]) * (arrPoint[1] - arrPoly[r][1]) / (arrPoly[t][1] - arrPoly[r][1]) + arrPoly[r][0] && (n = !n);
                                if (n) {
                                    ctx.restore();
                                    f = {
                                        datapoint: [g.percent, g.data],
                                        dataIndex: 0,
                                        series: g,
                                        seriesIndex: j
                                    };
                                    break a
                                }
                            }
                            ctx.restore()
                        }
                    }
                    f = null
                }
                if (d.grid.autoHighlight) for (h = 0; h < k.length; ++h) if (e = k[h], e.auto == a && !(f && e.series == f.series)) e = e.series,
                e == null && (k = [], p.triggerRedrawOverlay()),
                typeof e == "number" && (e = series[e]),
                e = C(e),
                e != -1 && (k.splice(e, 1), p.triggerRedrawOverlay());
                if (f) if (h = f.series, typeof h == "number" && (h = series[h]), e = C(h), e == -1) k.push({
                    series: h,
                    auto: a
                }), p.triggerRedrawOverlay();
                else if (!a) k[e].auto = !1;
                q.trigger(a, [{
                    pageX: b.pageX,
                    pageY: b.pageY
                },
                f])
            }
            function C(a) {
                for (var b = 0; b < k.length; ++b) if (k[b].series == a) return b;
                return -1
            }
            function J(a, b) {
                function d(a) {
                    if (!(a.angle < 0)) b.fillStyle = "rgba(255, 255, 255, " + f.series.pie.highlight.opacity + ")", b.beginPath(), Math.abs(a.angle - Math.PI * 2) > 1.0E-9 && b.moveTo(0, 0), b.arc(0, 0, e, a.startAngle, a.startAngle + a.angle, !1), b.closePath(), b.fill()
                }
                var f = a.getOptions(),
                    e = f.series.pie.radius > 1 ? f.series.pie.radius : m * f.series.pie.radius;
                b.save();
                b.translate(l, s);
                b.scale(1, f.series.pie.tilt);
                for (i = 0; i < k.length; ++i) d(k[i].series);
                z(b);
                b.restore()
            }
            var j = null,
                q = null,
                m = null,
                l = null,
                s = null,
                o = 0,
                u = !0,
                A = 10,
                G = 0.95,
                v = 0,
                w = !1,
                k = [];
            p.hooks.processOptions.push(function (a, b) {
                if (b.series.pie.show) {
                    b.grid.show = !1;
                    if (b.series.pie.label.show == "auto") b.series.pie.label.show = b.legend.show ? !1 : !0;
                    if (b.series.pie.radius == "auto") b.series.pie.radius = b.series.pie.label.show ? 0.75 : 1;
                    if (b.series.pie.tilt > 1) b.series.pie.tilt = 1;
                    if (b.series.pie.tilt < 0) b.series.pie.tilt = 0;
                    a.hooks.processDatapoints.push(D);
                    a.hooks.drawOverlay.push(J);
                    a.hooks.draw.push(F)
                }
            });
            p.hooks.bindEvents.push(function (a, b) {
                var d = a.getOptions();
                d.series.pie.show && d.grid.hoverable && b.unbind("mousemove").mousemove(H);
                d.series.pie.show && d.grid.clickable && b.unbind("click").click(I)
            })
        },
        options: d,
        name: "pie",
        version: "1.0"
    })
})(jQuery);
(function (b) {
    function c(D) {
        var h = null;
        var L = null;
        var n = null;
        var B = null;
        var p = null;
        var M = 0;
        var F = true;
        var o = 10;
        var w = 0.95;
        var A = 0;
        var d = false;
        var z = false;
        var j = [];
        D.hooks.processOptions.push(g);
        D.hooks.bindEvents.push(e);

        function g(O, N) {
            if (N.series.pie.show) {
                N.grid.show = false;
                if (N.series.pie.label.show == "auto") {
                    if (N.legend.show) {
                        N.series.pie.label.show = false
                    } else {
                        N.series.pie.label.show = true
                    }
                }
                if (N.series.pie.radius == "auto") {
                    if (N.series.pie.label.show) {
                        N.series.pie.radius = 3 / 4
                    } else {
                        N.series.pie.radius = 1
                    }
                }
                if (N.series.pie.tilt > 1) {
                    N.series.pie.tilt = 1
                }
                if (N.series.pie.tilt < 0) {
                    N.series.pie.tilt = 0
                }
                O.hooks.processDatapoints.push(E);
                O.hooks.drawOverlay.push(H);
                O.hooks.draw.push(r)
            }
        }
        function e(P, N) {
            var O = P.getOptions();
            if (O.series.pie.show && O.grid.hoverable) {
                N.unbind("mousemove").mousemove(t)
            }
            if (O.series.pie.show && O.grid.clickable) {
                N.unbind("click").click(l)
            }
        }
        function G(O) {
            var P = "";

            function N(S, T) {
                if (!T) {
                    T = 0
                }
                for (var R = 0; R < S.length; ++R) {
                    for (var Q = 0; Q < T; Q++) {
                        P += "\t"
                    }
                    if (typeof S[R] == "object") {
                        P += "" + R + ":\n";
                        N(S[R], T + 1)
                    } else {
                        P += "" + R + ": " + S[R] + "\n"
                    }
                }
            }
            N(O);
            alert(P)
        }
        function q(P) {
            for (var N = 0; N < P.length; ++N) {
                var O = parseFloat(P[N].data[0][1]);
                if (O) {
                    M += O
                }
            }
        }
        function E(Q, N, O, P) {
            if (!d) {
                d = true;
                h = Q.getCanvas();
                L = b(h).parent();
                a = Q.getOptions();
                Q.setData(K(Q.getData()))
            }
        }
        function I() {
            A = L.children().filter(".legend").children().width();
            n = Math.min(h.width, (h.height / a.series.pie.tilt)) / 2;
            p = (h.height / 2) + a.series.pie.offset.top;
            B = (h.width / 2);
            if (a.series.pie.offset.left == "auto") {
                if (a.legend.position.match("w")) {
                    B += A / 2
                } else {
                    B -= A / 2
                }
            } else {
                B += a.series.pie.offset.left
            }
            if (B < n) {
                B = n
            } else {
                if (B > h.width - n) {
                    B = h.width - n
                }
            }
        }
        function v(O) {
            for (var N = 0; N < O.length; ++N) {
                if (typeof (O[N].data) == "number") {
                    O[N].data = [
                        [1, O[N].data]
                    ]
                } else {
                    if (typeof (O[N].data) == "undefined" || typeof (O[N].data[0]) == "undefined") {
                        if (typeof (O[N].data) != "undefined" && typeof (O[N].data.label) != "undefined") {
                            O[N].label = O[N].data.label
                        }
                        O[N].data = [
                            [1, 0]
                        ]
                    }
                }
            }
            return O
        }
        function K(Q) {
            Q = v(Q);
            q(Q);
            var P = 0;
            var S = 0;
            var N = a.series.pie.combine.color;
            var R = [];
            for (var O = 0; O < Q.length; ++O) {
                Q[O].data[0][1] = parseFloat(Q[O].data[0][1]);
                if (!Q[O].data[0][1]) {
                    Q[O].data[0][1] = 0
                }
                if (Q[O].data[0][1] / M <= a.series.pie.combine.threshold) {
                    P += Q[O].data[0][1];
                    S++;
                    if (!N) {
                        N = Q[O].color
                    }
                } else {
                    R.push({
                        data: [
                            [1, Q[O].data[0][1]]
                        ],
                        color: Q[O].color,
                        label: Q[O].label,
                        angle: (Q[O].data[0][1] * (Math.PI * 2)) / M,
                        percent: (Q[O].data[0][1] / M * 100)
                    })
                }
            }
            if (S > 0) {
                R.push({
                    data: [
                        [1, P]
                    ],
                    color: N,
                    label: a.series.pie.combine.label,
                    angle: (P * (Math.PI * 2)) / M,
                    percent: (P / M * 100)
                })
            }
            return R
        }
        function r(S, Q) {
            if (!L) {
                return
            }
            ctx = Q;
            I();
            var T = S.getData();
            var P = 0;
            while (F && P < o) {
                F = false;
                if (P > 0) {
                    n *= w
                }
                P += 1;
                N();
                if (a.series.pie.tilt <= 0.8) {
                    O()
                }
                R()
            }
            if (P >= o) {
                N();
                L.prepend('<div class="error">Could not draw pie with labels contained inside canvas</div>')
            }
            if (S.setSeries && S.insertLegend) {
                S.setSeries(T);
                S.insertLegend()
            }
            function N() {
                ctx.clearRect(0, 0, h.width, h.height);
                L.children().filter(".pieLabel, .pieLabelBackground").remove()
            }
            function O() {
                var Z = 5;
                var Y = 15;
                var W = 10;
                var X = 0.02;
                if (a.series.pie.radius > 1) {
                    var U = a.series.pie.radius
                } else {
                    var U = n * a.series.pie.radius
                }
                if (U >= (h.width / 2) - Z || U * a.series.pie.tilt >= (h.height / 2) - Y || U <= W) {
                    return
                }
                ctx.save();
                ctx.translate(Z, Y);
                ctx.globalAlpha = X;
                ctx.fillStyle = "#000";
                ctx.translate(B, p);
                ctx.scale(1, a.series.pie.tilt);
                for (var V = 1; V <= W; V++) {
                    ctx.beginPath();
                    ctx.arc(0, 0, U, 0, Math.PI * 2, false);
                    ctx.fill();
                    U -= V
                }
                ctx.restore()
            }
            function R() {
                startAngle = Math.PI * a.series.pie.startAngle;
                if (a.series.pie.radius > 1) {
                    var U = a.series.pie.radius
                } else {
                    var U = n * a.series.pie.radius
                }
                ctx.save();
                ctx.translate(B, p);
                ctx.scale(1, a.series.pie.tilt);
                ctx.save();
                var Y = startAngle;
                for (var W = 0; W < T.length; ++W) {
                    T[W].startAngle = Y;
                    X(T[W].angle, T[W].color, true)
                }
                ctx.restore();
                ctx.save();
                ctx.lineWidth = a.series.pie.stroke.width;
                Y = startAngle;
                for (var W = 0; W < T.length; ++W) {
                    X(T[W].angle, a.series.pie.stroke.color, false)
                }
                ctx.restore();
                J(ctx);
                if (a.series.pie.label.show) {
                    V()
                }
                ctx.restore();

                function X(ab, Z, aa) {
                    if (ab <= 0) {
                        return
                    }
                    if (aa) {
                        ctx.fillStyle = Z
                    } else {
                        ctx.strokeStyle = Z;
                        ctx.lineJoin = "round"
                    }
                    ctx.beginPath();
                    if (Math.abs(ab - Math.PI * 2) > 1e-9) {
                        ctx.moveTo(0, 0)
                    } else {
                        if (b.browser.msie) {
                            ab -= 0.0001
                        }
                    }
                    ctx.arc(0, 0, U, Y, Y + ab, false);
                    ctx.closePath();
                    Y += ab;
                    if (aa) {
                        ctx.fill()
                    } else {
                        ctx.stroke()
                    }
                }
                function V() {
                    var ac = startAngle;
                    if (a.series.pie.label.radius > 1) {
                        var Z = a.series.pie.label.radius
                    } else {
                        var Z = n * a.series.pie.label.radius
                    }
                    for (var ab = 0; ab < T.length; ++ab) {
                        if (T[ab].percent >= a.series.pie.label.threshold * 100) {
                            aa(T[ab], ac, ab)
                        }
                        ac += T[ab].angle
                    }
                    function aa(ap, ai, ag) {
                        if (ap.data[0][1] == 0) {
                            return
                        }
                        var ar = a.legend.labelFormatter,
                            aq, ae = a.series.pie.label.formatter;
                        if (ar) {
                            aq = ar(ap.label, ap)
                        } else {
                            aq = ap.label
                        }
                        if (ae) {
                            aq = ae(aq, ap)
                        }
                        var aj = ((ai + ap.angle) + ai) / 2;
                        var ao = B + Math.round(Math.cos(aj) * Z);
                        var am = p + Math.round(Math.sin(aj) * Z) * a.series.pie.tilt;
                        var af = '<span class="pieLabel" id="pieLabel' + ag + '" style="position:absolute;top:' + am + "px;left:" + ao + 'px;">' + aq + "</span>";
                        L.append(af);
                        var an = L.children("#pieLabel" + ag);
                        var ad = (am - an.height() / 2);
                        var ah = (ao - an.width() / 2);
                        an.css("top", ad);
                        an.css("left", ah);
                        if (0 - ad > 0 || 0 - ah > 0 || h.height - (ad + an.height()) < 0 || h.width - (ah + an.width()) < 0) {
                            F = true
                        }
                        if (a.series.pie.label.background.opacity != 0) {
                            var ak = a.series.pie.label.background.color;
                            if (ak == null) {
                                ak = ap.color
                            }
                            var al = "top:" + ad + "px;left:" + ah + "px;";
                            b('<div class="pieLabelBackground" style="position:absolute;width:' + an.width() + "px;height:" + an.height() + "px;" + al + "background-color:" + ak + ';"> </div>').insertBefore(an).css("opacity", a.series.pie.label.background.opacity)
                        }
                    }
                }
            }
        }
        function J(N) {
            if (a.series.pie.innerRadius > 0) {
                N.save();
                innerRadius = a.series.pie.innerRadius > 1 ? a.series.pie.innerRadius : n * a.series.pie.innerRadius;
                N.globalCompositeOperation = "destination-out";
                N.beginPath();
                N.fillStyle = a.series.pie.stroke.color;
                N.arc(0, 0, innerRadius, 0, Math.PI * 2, false);
                N.fill();
                N.closePath();
                N.restore();
                N.save();
                N.beginPath();
                N.strokeStyle = a.series.pie.stroke.color;
                N.arc(0, 0, innerRadius, 0, Math.PI * 2, false);
                N.stroke();
                N.closePath();
                N.restore()
            }
        }
        function s(Q, R) {
            for (var S = false, P = -1, N = Q.length, O = N - 1; ++P < N; O = P) {
                ((Q[P][1] <= R[1] && R[1] < Q[O][1]) || (Q[O][1] <= R[1] && R[1] < Q[P][1])) && (R[0] < (Q[O][0] - Q[P][0]) * (R[1] - Q[P][1]) / (Q[O][1] - Q[P][1]) + Q[P][0]) && (S = !S)
            }
            return S
        }
        function u(R, P) {
            var T = D.getData(),
                O = D.getOptions(),
                N = O.series.pie.radius > 1 ? O.series.pie.radius : n * O.series.pie.radius;
            for (var Q = 0; Q < T.length; ++Q) {
                var S = T[Q];
                if (S.pie.show) {
                    ctx.save();
                    ctx.beginPath();
                    ctx.moveTo(0, 0);
                    ctx.arc(0, 0, N, S.startAngle, S.startAngle + S.angle, false);
                    ctx.closePath();
                    x = R - B;
                    y = P - p;
                    if (ctx.isPointInPath) {
                        if (ctx.isPointInPath(R - B, P - p)) {
                            ctx.restore();
                            return {
                                datapoint: [S.percent, S.data],
                                dataIndex: 0,
                                series: S,
                                seriesIndex: Q
                            }
                        }
                    } else {
                        p1X = (N * Math.cos(S.startAngle));
                        p1Y = (N * Math.sin(S.startAngle));
                        p2X = (N * Math.cos(S.startAngle + (S.angle / 4)));
                        p2Y = (N * Math.sin(S.startAngle + (S.angle / 4)));
                        p3X = (N * Math.cos(S.startAngle + (S.angle / 2)));
                        p3Y = (N * Math.sin(S.startAngle + (S.angle / 2)));
                        p4X = (N * Math.cos(S.startAngle + (S.angle / 1.5)));
                        p4Y = (N * Math.sin(S.startAngle + (S.angle / 1.5)));
                        p5X = (N * Math.cos(S.startAngle + S.angle));
                        p5Y = (N * Math.sin(S.startAngle + S.angle));
                        arrPoly = [
                            [0, 0],
                            [p1X, p1Y],
                            [p2X, p2Y],
                            [p3X, p3Y],
                            [p4X, p4Y],
                            [p5X, p5Y]
                        ];
                        arrPoint = [x, y];
                        if (s(arrPoly, arrPoint)) {
                            ctx.restore();
                            return {
                                datapoint: [S.percent, S.data],
                                dataIndex: 0,
                                series: S,
                                seriesIndex: Q
                            }
                        }
                    }
                    ctx.restore()
                }
            }
            return null
        }
        function t(N) {
            m("plothover", N)
        }
        function l(N) {
            m("plotclick", N)
        }
        function m(N, T) {
            var O = D.offset(),
                R = parseInt(T.pageX - O.left),
                P = parseInt(T.pageY - O.top),
                V = u(R, P);
            if (a.grid.autoHighlight) {
                for (var Q = 0; Q < j.length; ++Q) {
                    var S = j[Q];
                    if (S.auto == N && !(V && S.series == V.series)) {
                        f(S.series)
                    }
                }
            }
            if (V) {
                k(V.series, N)
            }
            var U = {
                pageX: T.pageX,
                pageY: T.pageY
            };
            L.trigger(N, [U, V])
        }
        function k(O, P) {
            if (typeof O == "number") {
                O = series[O]
            }
            var N = C(O);
            if (N == -1) {
                j.push({
                    series: O,
                    auto: P
                });
                D.triggerRedrawOverlay()
            } else {
                if (!P) {
                    j[N].auto = false
                }
            }
        }
        function f(O) {
            if (O == null) {
                j = [];
                D.triggerRedrawOverlay()
            }
            if (typeof O == "number") {
                O = series[O]
            }
            var N = C(O);
            if (N != -1) {
                j.splice(N, 1);
                D.triggerRedrawOverlay()
            }
        }
        function C(P) {
            for (var N = 0; N < j.length; ++N) {
                var O = j[N];
                if (O.series == P) {
                    return N
                }
            }
            return -1
        }
        function H(Q, R) {
            var P = Q.getOptions();
            var N = P.series.pie.radius > 1 ? P.series.pie.radius : n * P.series.pie.radius;
            R.save();
            R.translate(B, p);
            R.scale(1, P.series.pie.tilt);
            for (i = 0; i < j.length; ++i) {
                O(j[i].series)
            }
            J(R);
            R.restore();

            function O(S) {
                if (S.angle < 0) {
                    return
                }
                R.fillStyle = "rgba(255, 255, 255, " + P.series.pie.highlight.opacity + ")";
                R.beginPath();
                if (Math.abs(S.angle - Math.PI * 2) > 1e-9) {
                    R.moveTo(0, 0)
                }
                R.arc(0, 0, N, S.startAngle, S.startAngle + S.angle, false);
                R.closePath();
                R.fill()
            }
        }
    }
    var a = {
        series: {
            pie: {
                show: false,
                radius: "auto",
                innerRadius: 0,
                startAngle: 3 / 2,
                tilt: 1,
                offset: {
                    top: 0,
                    left: "auto"
                },
                stroke: {
                    color: "#FFF",
                    width: 1
                },
                label: {
                    show: "auto",
                    formatter: function (d, e) {
                        return '<div style="font-size:x-small;text-align:center;padding:2px;color:' + e.color + ';">' + d + "<br/>" + Math.round(e.percent) + "%</div>"
                    },
                    radius: 1,
                    background: {
                        color: null,
                        opacity: 0
                    },
                    threshold: 0
                },
                combine: {
                    threshold: -1,
                    color: null,
                    label: "Other"
                },
                highlight: {
                    opacity: 0.5
                }
            }
        }
    };
    b.plot.plugins.push({
        init: c,
        options: a,
        name: "pie",
        version: "1.0"
    })
})(jQuery);
/*

 FullCalendar v1.5.2
 http://arshaw.com/fullcalendar/

 Use fullcalendar.css for basic styling.
 For event drag & drop, requires jQuery UI draggable.
 For event resizing, requires jQuery UI resizable.

 Copyright (c) 2011 Adam Shaw
 Dual licensed under the MIT and GPL licenses, located in
 MIT-LICENSE.txt and GPL-LICENSE.txt respectively.

 Date: Sun Aug 21 22:06:09 2011 -0700

*/
(function (h, y) {
    function Oa(a) {
        h.extend(!0, ta, a)
    }
    function mb(a, c, b) {
        function e() {
            setTimeout(function () {
                !m.start && h("body")[0].offsetWidth !== 0 && l()
            }, 0)
        }
        function d(a) {
            if (!m || a != m.name) {
                A++;
                s();
                var b = m,
                    c;
                b ? ((b.beforeHide || Pa)(), ua(x, x.height()), b.element.hide()) : ua(x, 1);
                x.css("overflow", "hidden");
                (m = M[a]) ? m.element.show() : m = M[a] = new Z[a](c = U = h("<div class='fc-view fc-view-" + a + "' style='position:absolute'/>").appendTo(x), q);
                b && k.deactivateButton(b.name);
                k.activateButton(a);
                l();
                x.css("overflow", "");
                b && ua(x, 1);
                c || (m.afterShow || Pa)();
                A--
            }
        }
        function l(b) {
            if (t.offsetWidth !== 0) {
                A++;
                s();
                aa === y && g();
                var x = !1;
                !m.start || b || w < m.start || w >= m.end ? (m.render(w, b || 0), r(!0), x = !0) : m.sizeDirty ? (m.clearEvents(), r(), x = !0) : m.eventsDirty && (m.clearEvents(), x = !0);
                m.sizeDirty = !1;
                m.eventsDirty = !1;
                b = x;
                !c.lazyFetching || J(m.visStart, m.visEnd) ? i() : b && v();
                $ = a.outerWidth();
                k.updateTitle(m.title);
                b = new Date;
                b >= m.start && b < m.end ? k.disableButton("today") : k.enableButton("today");
                A--;
                m.trigger("viewDisplay", t)
            }
        }
        function j() {
            f();
            if (t.offsetWidth !== 0) g(), r(), s(), m.clearEvents(), m.renderEvents(F), m.sizeDirty = !1
        }
        function f() {
            h.each(M, function (a, b) {
                b.sizeDirty = !0
            })
        }
        function g() {
            aa = c.contentHeight ? c.contentHeight : c.height ? c.height - (K ? K.height() : 0) - na(x) : Math.round(x.width() / Math.max(c.aspectRatio, 0.5))
        }
        function r(a) {
            A++;
            m.setHeight(aa, a);
            U && (U.css("position", "relative"), U = null);
            m.setWidth(x.width(), a);
            A--
        }
        function n() {
            if (!A) if (m.start) {
                var b = ++R;
                setTimeout(function () {
                    if (b == R && !A && t.offsetWidth !== 0 && $ != ($ = a.outerWidth())) A++, j(), m.trigger("windowResize", t), A--
                }, 200)
            } else e()
        }
        function i() {
            p(m.visStart, m.visEnd)
        }
        function v(a) {
            S();
            if (t.offsetWidth !== 0) m.clearEvents(), m.renderEvents(F, a), m.eventsDirty = !1
        }
        function S() {
            h.each(M, function (a, b) {
                b.eventsDirty = !0
            })
        }
        function s() {
            m && m.unselect()
        }
        var q = this;
        q.options = c;
        q.render = function (b) {
            x ? (g(), f(), S(), l(b)) : (a.addClass("fc"), c.isRTL && a.addClass("fc-rtl"), c.theme && a.addClass("ui-widget"), x = h("<div class='fc-content' style='position:relative'/>").prependTo(a), k = new nb(q, c), (K = k.render()) && a.prepend(K), d(c.defaultView), h(window).resize(n), h("body")[0].offsetWidth !== 0 || e())
        };
        q.destroy = function () {
            h(window).unbind("resize", n);
            k.destroy();
            x.remove();
            a.removeClass("fc fc-rtl ui-widget")
        };
        q.refetchEvents = i;
        q.reportEvents = function (a) {
            F = a;
            v()
        };
        q.reportEventChange = function (a) {
            v(a)
        };
        q.rerenderEvents = v;
        q.changeView = d;
        q.select = function (a, b, c) {
            m.select(a, b, c === y ? !0 : c)
        };
        q.unselect = s;
        q.prev = function () {
            l(-1)
        };
        q.next = function () {
            l(1)
        };
        q.prevYear = function () {
            za(w, -1);
            l()
        };
        q.nextYear = function () {
            za(w, 1);
            l()
        };
        q.today = function () {
            w = new Date;
            l()
        };
        q.gotoDate = function (a, b, c) {
            a instanceof Date ? w = o(a) : Qa(w, a, b, c);
            l()
        };
        q.incrementDate = function (a, b, c) {
            a !== y && za(w, a);
            b !== y && Aa(w, b);
            c !== y && u(w, c);
            l()
        };
        q.formatDate = function (a, b) {
            return ba(a, b, c)
        };
        q.formatDates = function (a, b, x) {
            return Ba(a, b, x, c)
        };
        q.getDate = function () {
            return o(w)
        };
        q.getView = function () {
            return m
        };
        q.option = function (a, b) {
            if (b === y) return c[a];
            if (a == "height" || a == "contentHeight" || a == "aspectRatio") c[a] = b, j()
        };
        q.trigger = function (a, b) {
            if (c[a]) return c[a].apply(b || t, Array.prototype.slice.call(arguments, 2))
        };
        ob.call(q, c, b);
        var J = q.isFetchNeeded,
            p = q.fetchEvents,
            t = a[0],
            k, K, x, m, M = {},
            $, aa, U, R = 0,
            A = 0,
            w = new Date,
            F = [],
            E;
        Qa(w, c.year, c.month, c.date);
        c.droppable && h(document).bind("dragstart", function (a, b) {
            var x = a.target,
                d = h(x);
            if (!d.parents(".fc").length) {
                var e = c.dropAccept;
                if (h.isFunction(e) ? e.call(x, d) : d.is(e)) E = x, m.dragStart(E, a, b)
            }
        }).bind("dragstop", function (a, b) {
            E && (m.dragStop(E, a, b), E = null)
        })
    }
    function nb(a, c) {
        function b(b) {
            var e = h("<td class='fc-header-" + b + "'/>");
            (b = c.header[b]) && h.each(b.split(" "), function (b) {
                b > 0 && e.append("<span class='fc-header-space'/>");
                var g;
                h.each(this.split(","), function (b, f) {
                    if (f == "title") e.append("<span class='fc-header-title'><h2>&nbsp;</h2></span>"), g && g.addClass(d + "-corner-right"), g = null;
                    else {
                        var l;
                        a[f] ? l = a[f] : Z[f] && (l = function () {
                            s.removeClass(d + "-state-hover");
                            a.changeView(f)
                        });
                        if (l) {
                            var o = c.theme ? Ca(c.buttonIcons, f) : null,
                                u = Ca(c.buttonText, f),
                                s = h("<span class='fc-button fc-button-" + f + " " + d + "-state-default'><span class='fc-button-inner'><span class='fc-button-content'>" + (o ? "<span class='fc-icon-wrap'><span class='ui-icon ui-icon-" + o + "'/></span>" : u) + "</span><span class='fc-button-effect'><span></span></span></span></span>");
                            s && (s.click(function () {
                                s.hasClass(d + "-state-disabled") || l()
                            }).mousedown(function () {
                                s.not("." + d + "-state-active").not("." + d + "-state-disabled").addClass(d + "-state-down")
                            }).mouseup(function () {
                                s.removeClass(d + "-state-down")
                            }).hover(function () {
                                s.not("." + d + "-state-active").not("." + d + "-state-disabled").addClass(d + "-state-hover")
                            }, function () {
                                s.removeClass(d + "-state-hover").removeClass(d + "-state-down")
                            }).appendTo(e), g || s.addClass(d + "-corner-left"), g = s)
                        }
                    }
                });
                g && g.addClass(d + "-corner-right")
            });
            return e
        }
        this.render = function () {
            d = c.theme ? "ui" : "fc";
            if (c.header) return e = h("<table class='fc-header' style='width:100%'/>").append(h("<tr/>").append(b("left")).append(b("center")).append(b("right")))
        };
        this.destroy = function () {
            e.remove()
        };
        this.updateTitle = function (a) {
            e.find("h2").html(a)
        };
        this.activateButton = function (a) {
            e.find("span.fc-button-" + a).addClass(d + "-state-active")
        };
        this.deactivateButton = function (a) {
            e.find("span.fc-button-" + a).removeClass(d + "-state-active")
        };
        this.disableButton = function (a) {
            e.find("span.fc-button-" + a).addClass(d + "-state-disabled")
        };
        this.enableButton = function (a) {
            e.find("span.fc-button-" + a).removeClass(d + "-state-disabled")
        };
        var e = h([]),
            d
    }
    function ob(a, c) {
        function b(a, b) {
            e(a, function (c) {
                if (b == J) {
                    if (c) {
                        for (var e = 0; e < c.length; e++) c[e].source = a, f(c[e]);
                        k = k.concat(c)
                    }
                    p--;
                    p || i(k)
                }
            })
        }
        function e(b, c) {
            var d, f = H.sourceFetchers,
                g;
            for (d = 0; d < f.length; d++) if (g = f[d](b, s, q, c), g === !0) return;
            else if (typeof g == "object") {
                e(g, c);
                return
            }
            if (d = b.events) h.isFunction(d) ? (l(), d(o(s), o(q), function (a) {
                c(a);
                j()
            })) : h.isArray(d) ? c(d) : c();
            else if (b.url) {
                var t = b.success,
                    r = b.error,
                    i = b.complete;
                d = h.extend({}, b.data || {});
                f = oa(b.startParam, a.startParam);
                g = oa(b.endParam, a.endParam);
                f && (d[f] = Math.round(+s / 1E3));
                g && (d[g] = Math.round(+q / 1E3));
                l();
                h.ajax(h.extend({}, pb, b, {
                    data: d,
                    success: function (a) {
                        var a = a || [],
                            b = va(t, this, arguments);
                        h.isArray(b) && (a = b);
                        c(a)
                    },
                    error: function () {
                        va(r, this, arguments);
                        c()
                    },
                    complete: function () {
                        va(i, this, arguments);
                        j()
                    }
                }))
            } else c()
        }
        function d(a) {
            h.isFunction(a) || h.isArray(a) ? a = {
                events: a
            } : typeof a == "string" && (a = {
                url: a
            });
            if (typeof a == "object") {
                var b = a;
                if (b.className) {
                    if (typeof b.className == "string") b.className = b.className.split(/\s+/)
                } else b.className = [];
                for (var c = H.sourceNormalizers, d = 0; d < c.length; d++) c[d](b);
                u.push(a);
                return a
            }
        }
        function l() {
            t++ || r("loading", null, !0)
        }
        function j() {
            --t || r("loading", null, !1)
        }
        function f(b) {
            var c = b.source || {},
                d = oa(c.ignoreTimezone, a.ignoreTimezone);
            b._id = b._id || (b.id === y ? "_fc" + qb++ : b.id + "");
            if (b.date) {
                if (!b.start) b.start = b.date;
                delete b.date
            }
            b._start = o(b.start = Da(b.start, d));
            b.end = Da(b.end, d);
            if (b.end && b.end <= b.start) b.end = null;
            b._end = b.end ? o(b.end) : null;
            if (b.allDay === y) b.allDay = oa(c.allDayDefault, a.allDayDefault);
            if (b.className) {
                if (typeof b.className == "string") b.className = b.className.split(/\s+/)
            } else b.className = []
        }
        function g(a) {
            return (typeof a == "object" ? a.events || a.url : "") || a
        }
        this.isFetchNeeded = function (a, b) {
            return !s || a < s || b > q
        };
        this.fetchEvents = function (a, c) {
            s = a;
            q = c;
            k = [];
            var d = ++J,
                e = u.length;
            p = e;
            for (var f = 0; f < e; f++) b(u[f], d)
        };
        this.addEventSource = function (a) {
            if (a = d(a)) p++, b(a, J)
        };
        this.removeEventSource = function (a) {
            u = h.grep(u, function (b) {
                return !(b && a && g(b) == g(a))
            });
            k = h.grep(k, function (b) {
                return !(b.source && a && g(b.source) == g(a))
            });
            i(k)
        };
        this.updateEvent = function (a) {
            var b, c = k.length,
                d, e = n().defaultEventEnd,
                g = a.start - a._start,
                l = a.end ? a.end - (a._end || e(a)) : 0;
            for (b = 0; b < c; b++) if (d = k[b], d._id == a._id && d != a) d.start = new Date(+d.start + g), d.end = a.end ? d.end ? new Date(+d.end + l) : new Date(+e(d) + l) : null, d.title = a.title, d.url = a.url, d.allDay = a.allDay, d.className = a.className, d.editable = a.editable, d.color = a.color, d.backgroudColor = a.backgroudColor, d.borderColor = a.borderColor, d.textColor = a.textColor, f(d);
            f(a);
            i(k)
        };
        this.renderEvent = function (a, b) {
            f(a);
            if (!a.source) {
                if (b) v.events.push(a), a.source = v;
                k.push(a)
            }
            i(k)
        };
        this.removeEvents = function (a) {
            if (a) {
                if (!h.isFunction(a)) var b = a + "",
                    a = function (a) {
                        return a._id == b
                    };
                k = h.grep(k, a, !0);
                for (c = 0; c < u.length; c++) if (h.isArray(u[c].events)) u[c].events = h.grep(u[c].events, a, !0)
            } else {
                k = [];
                for (var c = 0; c < u.length; c++) if (h.isArray(u[c].events)) u[c].events = []
            }
            i(k)
        };
        this.clientEvents = function (a) {
            if (h.isFunction(a)) return h.grep(k, a);
            else if (a) return a += "", h.grep(k, function (b) {
                return b._id == a
            });
            return k
        };
        this.normalizeEvent = f;
        for (var r = this.trigger, n = this.getView, i = this.reportEvents, v = {
            events: []
        }, u = [v], s, q, J = 0, p = 0, t = 0, k = [], K = 0; K < c.length; K++) d(c[K])
    }
    function za(a, c, b) {
        a.setFullYear(a.getFullYear() + c);
        b || ga(a);
        return a
    }
    function Aa(a, c, b) {
        if (+a) {
            var c = a.getMonth() + c,
                e = o(a);
            e.setDate(1);
            e.setMonth(c);
            a.setMonth(c);
            for (b || ga(a); a.getMonth() != e.getMonth();) a.setDate(a.getDate() + (a < e ? 1 : -1))
        }
        return a
    }
    function u(a, c, b) {
        if (+a) {
            var c = a.getDate() + c,
                e = o(a);
            e.setHours(9);
            e.setDate(c);
            a.setDate(c);
            b || ga(a);
            Ea(a, e)
        }
        return a
    }
    function Ea(a, c) {
        if (+a) for (; a.getDate() != c.getDate();) a.setTime(+a + (a < c ? 1 : -1) * rb)
    }
    function I(a, c) {
        a.setMinutes(a.getMinutes() + c);
        return a
    }
    function ga(a) {
        a.setHours(0);
        a.setMinutes(0);
        a.setSeconds(0);
        a.setMilliseconds(0);
        return a
    }
    function o(a, c) {
        return c ? ga(new Date(+a)) : new Date(+a)
    }
    function Ra() {
        var a = 0,
            c;
        do c = new Date(1970, a++, 1);
        while (c.getHours());
        return c
    }
    function V(a, c, b) {
        for (c = c || 1; !a.getDay() || b && a.getDay() == 1 || !b && a.getDay() == 6;) u(a, c);
        return a
    }
    function T(a, c) {
        return Math.round((o(a, !0) - o(c, !0)) / Sa)
    }
    function Qa(a, c, b, e) {
        c !== y && c != a.getFullYear() && (a.setDate(1), a.setMonth(0), a.setFullYear(c));
        b !== y && b != a.getMonth() && (a.setDate(1), a.setMonth(b));
        e !== y && a.setDate(e)
    }
    function Da(a, c) {
        if (typeof a == "object") return a;
        if (typeof a == "number") return new Date(a * 1E3);
        if (typeof a == "string") {
            if (a.match(/^\d+(\.\d+)?$/)) return new Date(parseFloat(a) * 1E3);
            c === y && (c = !0);
            return Ta(a, c) || (a ? new Date(a) : null)
        }
        return null
    }
    function Ta(a, c) {
        var b = a.match(/^([0-9]{4})(-([0-9]{2})(-([0-9]{2})([T ]([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2})(:?([0-9]{2}))?))?)?)?)?$/);
        if (!b) return null;
        var e = new Date(b[1], 0, 1);
        if (c || !b[13]) {
            var d = new Date(b[1], 0, 1, 9, 0);
            b[3] && (e.setMonth(b[3] - 1), d.setMonth(b[3] - 1));
            b[5] && (e.setDate(b[5]), d.setDate(b[5]));
            Ea(e, d);
            b[7] && e.setHours(b[7]);
            b[8] && e.setMinutes(b[8]);
            b[10] && e.setSeconds(b[10]);
            b[12] && e.setMilliseconds(Number("0." + b[12]) * 1E3);
            Ea(e, d)
        } else e.setUTCFullYear(b[1], b[3] ? b[3] - 1 : 0, b[5] || 1), e.setUTCHours(b[7] || 0, b[8] || 0, b[10] || 0, b[12] ? Number("0." + b[12]) * 1E3 : 0), b[14] && (d = Number(b[16]) * 60 + (b[18] ? Number(b[18]) : 0), d *= b[15] == "-" ? 1 : -1, e = new Date(+e + d * 6E4));
        return e
    }
    function Fa(a) {
        if (typeof a == "number") return a * 60;
        if (typeof a == "object") return a.getHours() * 60 + a.getMinutes();
        if (a = a.match(/(\d+)(?::(\d+))?\s*(\w+)?/)) {
            var c = parseInt(a[1], 10);
            a[3] && (c %= 12, a[3].toLowerCase().charAt(0) == "p" && (c += 12));
            return c * 60 + (a[2] ? parseInt(a[2], 10) : 0)
        }
    }
    function ba(a, c, b) {
        return Ba(a, null, c, b)
    }
    function Ba(a, c, b, e) {
        var e = e || ta,
            d = a,
            l = c,
            j, f = b.length,
            g, h, n, i = "";
        for (j = 0; j < f; j++) if (g = b.charAt(j), g == "'") for (h = j + 1; h < f; h++) {
            if (b.charAt(h) == "'") {
                d && (i += h == j + 1 ? "'" : b.substring(j + 1, h), j = h);
                break
            }
        } else if (g == "(") for (h = j + 1; h < f; h++) {
            if (b.charAt(h) == ")") {
                j = ba(d, b.substring(j + 1, h), e);
                parseInt(j.replace(/\D/, ""), 10) && (i += j);
                j = h;
                break
            }
        } else if (g == "[") for (h = j + 1; h < f; h++) {
            if (b.charAt(h) == "]") {
                g = b.substring(j + 1, h);
                j = ba(d, g, e);
                j != ba(l, g, e) && (i += j);
                j = h;
                break
            }
        } else if (g == "{") d = c, l = a;
        else if (g == "}") d = a, l = c;
        else {
            for (h = f; h > j; h--) if (n = sb[b.substring(j, h)]) {
                d && (i += n(d, e));
                j = h - 1;
                break
            }
            h == j && d && (i += g)
        }
        return i
    }
    function pa(a) {
        var c;
        a.end ? (c = a.end, a = a.allDay, c = o(c), c = a || c.getHours() || c.getMinutes() ? u(c, 1) : ga(c)) : c = u(o(a.start), 1);
        return c
    }
    function tb(a, c) {
        return (c.msLength - a.msLength) * 100 + (a.event.start - c.event.start)
    }
    function Ga(a, c, b, e) {
        var d = [],
            h, j = a.length,
            f, g, r, n, i;
        for (h = 0; h < j; h++) f = a[h], g = f.start, r = c[h], r > b && g < e && (g < b ? (g = o(b), n = !1) : n = !0, r > e ? (r = o(e), i = !1) : i = !0, d.push({
            event: f,
            start: g,
            end: r,
            isStart: n,
            isEnd: i,
            msLength: r - g
        }));
        return d.sort(tb)
    }
    function Ha(a) {
        var c = [],
            b, e = a.length,
            d, h, j, f;
        for (b = 0; b < e; b++) {
            d = a[b];
            for (h = 0;;) {
                j = !1;
                if (c[h]) for (f = 0; f < c[h].length; f++) if (c[h][f].end > d.start && c[h][f].start < d.end) {
                    j = !0;
                    break
                }
                if (j) h++;
                else break
            }
            c[h] ? c[h].push(d) : c[h] = [d]
        }
        return c
    }
    function Ua(a, c, b) {
        a.unbind("mouseover").mouseover(function (a) {
            for (var d = a.target, l; d != this;) l = d, d = d.parentNode;
            if ((d = l._fci) !== y) l._fci = y, l = c[d], b(l.event, l.element, l), h(a.target).trigger(a);
            a.stopPropagation()
        })
    }
    function qa(a, c, b) {
        for (var e = 0, d; e < a.length; e++) d = h(a[e]), d.width(Math.max(0, c - Ia(d, b)))
    }
    function Va(a, c, b) {
        for (var e = 0, d; e < a.length; e++) d = h(a[e]), d.height(Math.max(0, c - na(d, b)))
    }
    function Ia(a, c) {
        return (parseFloat(h.curCSS(a[0], "paddingLeft", !0)) || 0) + (parseFloat(h.curCSS(a[0], "paddingRight", !0)) || 0) + ((parseFloat(h.curCSS(a[0], "borderLeftWidth", !0)) || 0) + (parseFloat(h.curCSS(a[0], "borderRightWidth", !0)) || 0)) + (c ? (parseFloat(h.curCSS(a[0], "marginLeft", !0)) || 0) + (parseFloat(h.curCSS(a[0], "marginRight", !0)) || 0) : 0)
    }
    function na(a, c) {
        return (parseFloat(h.curCSS(a[0], "paddingTop", !0)) || 0) + (parseFloat(h.curCSS(a[0], "paddingBottom", !0)) || 0) + ((parseFloat(h.curCSS(a[0], "borderTopWidth", !0)) || 0) + (parseFloat(h.curCSS(a[0], "borderBottomWidth", !0)) || 0)) + (c ? Wa(a) : 0)
    }
    function Wa(a) {
        return (parseFloat(h.curCSS(a[0], "marginTop", !0)) || 0) + (parseFloat(h.curCSS(a[0], "marginBottom", !0)) || 0)
    }
    function ua(a, c) {
        c = typeof c == "number" ? c + "px" : c;
        a.each(function (a, e) {
            e.style.cssText += ";min-height:" + c + ";_height:" + c
        })
    }
    function Pa() {}
    function Xa(a, c) {
        return a - c
    }
    function Y(a) {
        return (a < 10 ? "0" : "") + a
    }
    function Ca(a, c) {
        if (a[c] !== y) return a[c];
        for (var b = c.split(/(?=[A-Z])/), e = b.length - 1, d; e >= 0; e--) if (d = a[b[e].toLowerCase()], d !== y) return d;
        return a[""]
    }
    function ca(a) {
        return a.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/'/g, "&#039;").replace(/"/g, "&quot;").replace(/\n/g, "<br />")
    }
    function Ya(a) {
        return a.id + "/" + a.className + "/" + a.style.cssText.replace(/(^|;)\s*(top|left|width|height)\s*:[^;]*/ig, "")
    }
    function Ja(a) {
        a.attr("unselectable", "on").css("MozUserSelect", "none").bind("selectstart.ui", function () {
            return !1
        })
    }
    function wa(a) {
        a.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")
    }
    function Ka(a, c) {
        a.each(function (a, e) {
            e.className = e.className.replace(/^fc-\w*/, "fc-" + ub[c.getDay()])
        })
    }
    function Za(a, c) {
        var b = a.source || {},
            e = a.color,
            d = b.color,
            h = c("eventColor"),
            j = a.backgroundColor || e || b.backgroundColor || d || c("eventBackgroundColor") || h,
            e = a.borderColor || e || b.borderColor || d || c("eventBorderColor") || h,
            b = a.textColor || b.textColor || c("eventTextColor"),
            d = [];
        j && d.push("background-color:" + j);
        e && d.push("border-color:" + e);
        b && d.push("color:" + b);
        return d.join(";")
    }
    function va(a, c, b) {
        h.isFunction(a) && (a = [a]);
        if (a) {
            var e, d;
            for (e = 0; e < a.length; e++) d = a[e].apply(c, b) || d;
            return d
        }
    }
    function oa() {
        for (var a = 0; a < arguments.length; a++) if (arguments[a] !== y) return arguments[a]
    }
    function La(a, c, b) {
        function e(a) {
            var b = a || F == 1,
                c = i.start.getMonth(),
                d = ga(new Date),
                e, f, g;
            b && K.each(function (a, b) {
                e = h(b);
                f = r(a);
                e.html(t(f, Q));
                Ka(e, f)
            });
            M.each(function (a, g) {
                e = h(g);
                f = r(a);
                f.getMonth() == c ? e.removeClass("fc-other-month") : e.addClass("fc-other-month"); + f == +d ? e.addClass(z + "-state-highlight fc-today") : e.removeClass(z + "-state-highlight fc-today");
                e.find("div.fc-day-number").text(f.getDate());
                b && Ka(e, f)
            });
            m.each(function (a, b) {
                g = h(b);
                a < F ? (g.show(), a == F - 1 ? g.addClass("fc-last") : g.removeClass("fc-last")) : g.hide()
            })
        }
        function d(a) {
            if (!v("selectable")) {
                var b = parseInt(this.className.match(/fc\-day(\d+)/)[1]),
                    b = r(b);
                y("dayClick", this, b, !0, a)
            }
        }
        function l(a, b, c) {
            c && G.build();
            for (var c = o(i.visStart), e = u(o(c), E), f = 0; f < F; f++) {
                var h = new Date(Math.max(c, a)),
                    g = new Date(Math.min(e, b));
                if (h < g) {
                    var Q;
                    O ? (Q = T(g, c) * D + L + 1, h = T(h, c) * D + L + 1) : (Q = T(h, c), h = T(g, c));
                    j(f, Q, f, h - 1).click(d).mousedown(p)
                }
                u(c, 7);
                u(e, 7)
            }
        }
        function j(b, c, d, e) {
            b = G.rect(b, c, d, e, a);
            return q(b, a)
        }
        function f(a) {
            return {
                row: Math.floor(T(a, i.visStart) / 7),
                col: n(a.getDay())
            }
        }
        function g(a) {
            return u(o(i.visStart), a.row * 7 + a.col * D + L)
        }
        function r(a) {
            return u(o(i.visStart), Math.floor(a / E) * 7 + a % E * D + L)
        }
        function n(a) {
            return (a - Math.max(C, da) + E) % E * D + L
        }
        var i = this;
        i.renderBasic = function (b, c, f, g) {
            F = c;
            E = f;
            (O = v("isRTL")) ? (D = -1, L = E - 1) : (D = 1, L = 0);
            C = v("firstDay");
            da = v("weekends") ? 0 : 1;
            z = v("theme") ? "ui" : "fc";
            Q = v("columnFormat");
            if (c = !x) {
                var j = z + "-widget-header",
                    t = z + "-widget-content",
                    i, f = "<table class='fc-border-separate' style='width:100%' cellspacing='0'><thead><tr>";
                for (i = 0; i < E; i++) f += "<th class='fc- " + j + "'/>";
                f += "</tr></thead><tbody>";
                for (i = 0; i < b; i++) {
                    f += "<tr class='fc-week" + i + "'>";
                    for (j = 0; j < E; j++) f += "<td class='fc- " + t + " fc-day" + (i * E + j) + "'><div>" + (g ? "<div class='fc-day-number'/>" : "") + "<div class='fc-day-content'><div style='position:relative'>&nbsp;</div></div></div></td>";
                    f += "</tr>"
                }
                f += "</tbody></table>";
                b = h(f).appendTo(a);
                k = b.find("thead");
                K = k.find("th");
                x = b.find("tbody");
                m = x.find("tr");
                M = x.find("td");
                $ = M.filter(":first-child");
                aa = m.eq(0).find("div.fc-day-content div");
                wa(k.add(k.find("tr")));
                wa(m);
                m.eq(0).addClass("fc-first");
                M.click(d).mousedown(p);
                U = h("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(a)
            } else s();
            e(c)
        };
        i.setHeight = function (a) {
            A = a;
            var a = A - k.height(),
                b, c, d;
            v("weekMode") == "variable" ? b = c = Math.floor(a / (F == 1 ? 2 : 6)) : (b = Math.floor(a / F), c = a - b * (F - 1));
            $.each(function (a, e) {
                a < F && (d = h(e), ua(d.find("> div"), (a == F - 1 ? c : b) - na(d)))
            })
        };
        i.setWidth = function (a) {
            R = a;
            N.clear();
            w = Math.floor(R / E);
            qa(K.slice(0, -1), w)
        };
        i.renderDayOverlay = l;
        i.defaultSelectionEnd = function (a) {
            return o(a)
        };
        i.renderSelection = function (a, b) {
            l(a, u(o(b), 1), !0)
        };
        i.clearSelection = function () {
            J()
        };
        i.reportDayClick = function (a, b, c) {
            var d = f(a);
            y("dayClick", M[d.row * E + d.col], a, b, c)
        };
        i.dragStart = function (a, b) {
            B.start(function (a) {
                J();
                a && j(a.row, a.col, a.row, a.col)
            }, b)
        };
        i.dragStop = function (a, b, c) {
            var d = B.stop();
            J();
            d && (d = g(d), y("drop", a, d, !0, b, c))
        };
        i.defaultEventEnd = function (a) {
            return o(a.start)
        };
        i.getHoverListener = function () {
            return B
        };
        i.colContentLeft = function (a) {
            return N.left(a)
        };
        i.colContentRight = function (a) {
            return N.right(a)
        };
        i.dayOfWeekCol = n;
        i.dateCell = f;
        i.cellDate = g;
        i.cellIsAllDay = function () {
            return !0
        };
        i.allDayRow = function (a) {
            return m.eq(a)
        };
        i.allDayBounds = function () {
            return {
                left: 0,
                right: R
            }
        };
        i.getRowCnt = function () {
            return F
        };
        i.getColCnt = function () {
            return E
        };
        i.getColWidth = function () {
            return w
        };
        i.getDaySegmentContainer = function () {
            return U
        };
        db.call(i, a, c, b);
        eb.call(i);
        fb.call(i);
        vb.call(i);
        var v = i.opt,
            y = i.trigger,
            s = i.clearEvents,
            q = i.renderOverlay,
            J = i.clearOverlays,
            p = i.daySelectionMousedown,
            t = c.formatDate,
            k, K, x, m, M, $, aa, U, R, A, w, F, E, G, B, N, O, D, L, C, da, z, Q;
        Ja(a.addClass("fc-grid"));
        G = new gb(function (a, b) {
            var c, d, e;
            K.each(function (a, f) {
                c = h(f);
                d = c.offset().left;
                a && (e[1] = d);
                e = [d];
                b[a] = e
            });
            e[1] = d + c.outerWidth();
            m.each(function (b, f) {
                if (b < F) c = h(f), d = c.offset().top, b && (e[1] = d), e = [d], a[b] = e
            });
            e[1] = d + c.outerHeight()
        });
        B = new hb(G);
        N = new ib(function (a) {
            return aa.eq(a)
        })
    }
    function vb() {
        function a(a) {
            var c = p(),
                d = t(),
                e = o(b.visStart),
                d = u(o(e), d),
                f = h.map(a, pa),
                g, j, i, l, k, n, r = [];
            for (g = 0; g < c; g++) {
                j = Ha(Ga(a, f, e, d));
                for (i = 0; i < j.length; i++) {
                    l = j[i];
                    for (k = 0; k < l.length; k++) n = l[k], n.row = g, n.level = i, r.push(n)
                }
                u(e, 7);
                u(d, 7)
            }
            return r
        }
        function c(a, b) {
            var c = s(),
                f;
            b.draggable({
                zIndex: 9,
                delay: 50,
                opacity: e("dragOpacity"),
                revertDuration: e("dragRevertDuration"),
                start: function (g, h) {
                    d("eventDragStart", b, a, g, h);
                    i(a, b);
                    c.start(function (c, d, g, h) {
                        b.draggable("option", "revert", !c || !g && !h);
                        J();
                        c ? (f = g * 7 + h * (e("isRTL") ? -1 : 1), q(u(o(a.start), f), u(pa(a), f))) : f = 0
                    }, g, "drag")
                },
                stop: function (e, g) {
                    c.stop();
                    J();
                    d("eventDragStop", b, a, e, g);
                    f ? v(this, a, f, 0, a.allDay, e, g) : (b.css("filter", ""), n(a, b))
                }
            })
        }
        var b = this;
        b.renderEvents = function (b, c) {
            f(b);
            k(a(b), c)
        };
        b.compileDaySegs = a;
        b.clearEvents = function () {
            g();
            y().empty()
        };
        b.bindDaySeg = function (a, b, d) {
            l(a) && c(a, b);
            d.isEnd && j(a) && K(a, b, d);
            r(a, b)
        };
        jb.call(b);
        var e = b.opt,
            d = b.trigger,
            l = b.isEventDraggable,
            j = b.isEventResizable,
            f = b.reportEvents,
            g = b.reportEventClear,
            r = b.eventElementHandlers,
            n = b.showEvents,
            i = b.hideEvents,
            v = b.eventDrop,
            y = b.getDaySegmentContainer,
            s = b.getHoverListener,
            q = b.renderDayOverlay,
            J = b.clearOverlays,
            p = b.getRowCnt,
            t = b.getColCnt,
            k = b.renderDaySegs,
            K = b.resizableDayEvent
    }
    function kb(a, c, b) {
        function e() {
            function a() {
                z.scrollTop(d)
            }
            var b = Ra(),
                c = o(b);
            c.setHours(t("firstHour"));
            var d = v(b, c) + 1;
            a();
            setTimeout(a, 0)
        }
        function d(a) {
            if (!t("selectable")) {
                var b = Math.min(W - 1, Math.floor((a.pageX - A.offset().left - X) / xa)),
                    c = r(b),
                    d = this.parentNode.className.match(/fc-slot(\d+)/);
                d ? (d = parseInt(d[1]) * t("slotMinutes"), c.setHours(Math.floor(d / 60)), c.setMinutes(d % 60 + ia), k("dayClick", G[b], c, !1, a)) : k("dayClick", G[b], c, !0, a)
            }
        }
        function l(a, b, c) {
            c && ja.build();
            var e = o(p.visStart);
            ba ? (c = T(b, e) * ea + fa + 1, a = T(a, e) * ea + fa + 1) : (c = T(a, e), a = T(b, e));
            c = Math.max(0, c);
            a = Math.min(W, a);
            c < a && j(0, c, 0, a - 1).click(d).mousedown(aa)
        }
        function j(a, b, c, d) {
            a = ja.rect(a, b, c, d, D);
            return x(a, D)
        }
        function f(a, b) {
            for (var c = o(p.visStart), e = u(o(c), 1), f = 0; f < W; f++) {
                var g = new Date(Math.max(c, a)),
                    h = new Date(Math.min(e, b));
                if (g < h) {
                    var j = f * ea + fa,
                        j = ja.rect(0, j, 0, j, Q),
                        g = v(c, g),
                        h = v(c, h);
                    j.top = g;
                    j.height = h - g;
                    x(j, Q).click(d).mousedown(q)
                }
                u(c, 1);
                u(e, 1)
            }
        }
        function g(a) {
            var b = r(a.col),
                a = a.row;
            t("allDaySlot") && a--;
            a >= 0 && I(b, ia + a * t("slotMinutes"));
            return b
        }
        function r(a) {
            return u(o(p.visStart), a * ea + fa)
        }
        function n(a) {
            return t("allDaySlot") && !a.row
        }
        function i(a) {
            return (a - Math.max(V, Z) + W) % W * ea + fa
        }
        function v(a, b) {
            a = o(a, !0);
            if (b < I(o(a), ia)) return 0;
            if (b >= I(o(a), Y)) return ha.height();
            var c = t("slotMinutes"),
                d = b.getHours() * 60 + b.getMinutes() - ia,
                e = Math.floor(d / c),
                f = H[e];
            if (f === y) f = H[e] = ha.find("tr:eq(" + e + ") td div")[0].offsetTop;
            return Math.max(0, Math.round(f - 1 + ra * (d % c / c)))
        }
        function S(a, b) {
            var c = t("selectHelper");
            ja.build();
            if (c) {
                var e = T(a, p.visStart) * ea + fa;
                if (e >= 0 && e < W) {
                    var e = ja.rect(0, e, 0, e, Q),
                        g = v(a, a),
                        j = v(a, b);
                    if (j > g) {
                        e.top = g;
                        e.height = j - g;
                        e.left += 2;
                        e.width -= 5;
                        if (h.isFunction(c)) {
                            if (c = c(a, b)) e.position = "absolute", e.zIndex = 8, P = h(c).css(e).appendTo(Q)
                        } else e.isStart = !0, e.isEnd = !0, P = h(U({
                            title: "",
                            start: a,
                            end: b,
                            className: ["fc-select-helper"],
                            editable: !1
                        }, e)), P.css("opacity", t("dragOpacity"));
                        P && (P.click(d).mousedown(q), Q.append(P), qa(P, e.width, !0), Va(P, e.height, !0))
                    }
                }
            } else f(a, b)
        }

        function s() {
            m();
            P && (P.remove(), P = null)
        }
        function q(a) {
            if (a.which == 1 && t("selectable")) {
                $(a);
                var b;
                ma.start(function (a, c) {
                    s();
                    if (a && a.col == c.col && !n(a)) {
                        var d = g(c),
                            e = g(a);
                        b = [d, I(o(d), t("slotMinutes")), e, I(o(e), t("slotMinutes"))].sort(Xa);
                        S(b[0], b[3])
                    } else b = null
                }, a);
                h(document).one("mouseup", function (a) {
                    ma.stop();
                    b && (+b[0] == +b[1] && J(b[0], !1, a), M(b[0], b[3], !1, a))
                })
            }
        }
        function J(a, b, c) {
            k("dayClick", G[i(a.getDay())], a, b, c)
        }
        var p = this;
        p.renderAgenda = function (b) {
            W = b;
            sa = t("theme") ? "ui" : "fc";
            Z = t("weekends") ? 0 : 1;
            V = t("firstDay");
            (ba = t("isRTL")) ? (ea = -1, fa = W - 1) : (ea = 1, fa = 0);
            ia = Fa(t("minTime"));
            Y = Fa(t("maxTime"));
            ca = t("columnFormat");
            if (A) K();
            else {
                var b = sa + "-widget-header",
                    c = sa + "-widget-content",
                    e, f, g, j, i, l = t("slotMinutes") % 15 == 0;
                e = "<table style='width:100%' class='fc-agenda-days fc-border-separate' cellspacing='0'><thead><tr><th class='fc-agenda-axis " + b + "'>&nbsp;</th>";
                for (f = 0; f < W; f++) e += "<th class='fc- fc-col" + f + " " + b + "'/>";
                e += "<th class='fc-agenda-gutter " + b + "'>&nbsp;</th></tr></thead><tbody><tr><th class='fc-agenda-axis " + b + "'>&nbsp;</th>";
                for (f = 0; f < W; f++) e += "<td class='fc- fc-col" + f + " " + c + "'><div><div class='fc-day-content'><div style='position:relative'>&nbsp;</div></div></div></td>";
                e += "<td class='fc-agenda-gutter " + c + "'>&nbsp;</td></tr></tbody></table>";
                A = h(e).appendTo(a);
                w = A.find("thead");
                F = w.find("th").slice(1, -1);
                E = A.find("tbody");
                G = E.find("td").slice(0, -1);
                B = G.find("div.fc-day-content div");
                N = G.eq(0);
                O = N.find("> div");
                wa(w.add(w.find("tr")));
                wa(E.add(E.find("tr")));
                ka = w.find("th:first");
                la = A.find(".fc-agenda-gutter");
                D = h("<div style='position:absolute;z-index:2;left:0;width:100%'/>").appendTo(a);
                t("allDaySlot") ? (L = h("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(D), e = "<table style='width:100%' class='fc-agenda-allday' cellspacing='0'><tr><th class='" + b + " fc-agenda-axis'>" + t("allDayText") + "</th><td><div class='fc-day-content'><div style='position:relative'/></div></td><th class='" + b + " fc-agenda-gutter'>&nbsp;</th></tr></table>", C = h(e).appendTo(D), da = C.find("tr"), da.find("td").click(d).mousedown(aa), ka = ka.add(C.find("th:first")), la = la.add(C.find("th.fc-agenda-gutter")), D.append("<div class='fc-agenda-divider " + b + "'><div class='fc-agenda-divider-inner'/></div>")) : L = h([]);
                z = h("<div style='position:absolute;width:100%;overflow-x:hidden;overflow-y:auto'/>").appendTo(D);
                Q = h("<div style='position:relative;width:100%;overflow:hidden'/>").appendTo(z);
                $a = h("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(Q);
                e = "<table class='fc-agenda-slots' style='width:100%' cellspacing='0'><tbody>";
                g = Ra();
                j = I(o(g), Y);
                I(g, ia);
                for (f = Ma = 0; g < j; f++) i = g.getMinutes(), e += "<tr class='fc-slot" + f + " " + (!i ? "" : "fc-minor") + "'><th class='fc-agenda-axis " + b + "'>" + (!l || !i ? R(g, t("axisFormat")) : "&nbsp;") + "</th><td class='" + c + "'><div style='position:relative'>&nbsp;</div></td></tr>", I(g, t("slotMinutes")), Ma++;
                e += "</tbody></table>";
                ha = h(e).appendTo(Q);
                ab = ha.find("div:first");
                ha.find("td").click(d).mousedown(q);
                ka = ka.add(ha.find("th:first"))
            }
            g = ga(new Date);
            for (b = 0; b < W; b++) f = r(b), c = F.eq(b), c.html(R(f, ca)), e = G.eq(b), +f == +g ? e.addClass(sa + "-state-highlight fc-today") : e.removeClass(sa + "-state-highlight fc-today"), Ka(c.add(e), f)
        };
        p.setWidth = function (a) {
            bb = a;
            ya.clear();
            X = 0;
            qa(ka.width("").each(function (a, b) {
                X = Math.max(X, h(b).outerWidth())
            }), X);
            a = z[0].clientWidth;
            (Na = z.width() - a) ? (qa(la, Na), la.show().prev().removeClass("fc-last")) : la.hide().prev().addClass("fc-last");
            xa = Math.floor((a - X) / W);
            qa(F.slice(0, -1), xa)
        };
        p.setHeight = function (a, b) {
            a === y && (a = cb);
            cb = a;
            H = {};
            var c = E.position().top,
                d = z.position().top,
                f = Math.min(a - c, ha.height() + d + 1);
            O.height(f - na(N));
            D.css("top", c);
            z.height(f - d - 1);
            ra = ab.height() + 1;
            b && e()
        };
        p.beforeHide = function () {
            lb = z.scrollTop()
        };
        p.afterShow = function () {
            z.scrollTop(lb)
        };
        p.defaultEventEnd = function (a) {
            var b = o(a.start);
            return a.allDay ? b : I(b, t("defaultEventMinutes"))
        };
        p.timePosition = v;
        p.dayOfWeekCol = i;
        p.dateCell = function (a) {
            return {
                row: Math.floor(T(a, p.visStart) / 7),
                col: i(a.getDay())
            }
        };
        p.cellDate = g;
        p.cellIsAllDay = n;
        p.allDayRow = function () {
            return da
        };
        p.allDayBounds = function () {
            return {
                left: X,
                right: bb - Na
            }
        };
        p.getHoverListener = function () {
            return ma
        };
        p.colContentLeft = function (a) {
            return ya.left(a)
        };
        p.colContentRight = function (a) {
            return ya.right(a)
        };
        p.getDaySegmentContainer = function () {
            return L
        };
        p.getSlotSegmentContainer = function () {
            return $a
        };
        p.getMinMinute = function () {
            return ia
        };
        p.getMaxMinute = function () {
            return Y
        };
        p.getBodyContent = function () {
            return Q
        };
        p.getRowCnt = function () {
            return 1
        };
        p.getColCnt = function () {
            return W
        };
        p.getColWidth = function () {
            return xa
        };
        p.getSlotHeight = function () {
            return ra
        };
        p.defaultSelectionEnd = function (a, b) {
            return b ? o(a) : I(o(a), t("slotMinutes"))
        };
        p.renderDayOverlay = l;
        p.renderSelection = function (a, b, c) {
            c ? t("allDaySlot") && l(a, u(o(b), 1), !0) : S(a, b)
        };
        p.clearSelection = s;
        p.reportDayClick = J;
        p.dragStart = function (a, b) {
            ma.start(function (a) {
                m();
                if (a) if (n(a)) j(a.row, a.col, a.row, a.col);
                else {
                    var a = g(a),
                        b = I(o(a), t("defaultEventMinutes"));
                    f(a, b)
                }
            }, b)
        };
        p.dragStop = function (a, b, c) {
            var d = ma.stop();
            m();
            d && k("drop", a, g(d), n(d), b, c)
        };
        db.call(p, a, c, b);
        eb.call(p);
        fb.call(p);
        wb.call(p);
        var t = p.opt,
            k = p.trigger,
            K = p.clearEvents,
            x = p.renderOverlay,
            m = p.clearOverlays,
            M = p.reportSelection,
            $ = p.unselect,
            aa = p.daySelectionMousedown,
            U = p.slotSegHtml,
            R = c.formatDate,
            A, w, F, E, G, B, N, O, D, L, C, da, z, Q, $a, ha, ab, ka, la, P, bb, cb, X, xa, Na, ra, lb, W, Ma, ja, ma, ya, H = {},
            sa, V, Z, ba, ea, fa, ia, Y, ca;
        Ja(a.addClass("fc-agenda"));
        ja = new gb(function (a, b) {
            var c, d, e;
            F.each(function (a, f) {
                c = h(f);
                d = c.offset().left;
                a && (e[1] = d);
                e = [d];
                b[a] = e
            });
            e[1] = d + c.outerWidth();
            if (t("allDaySlot")) c = da, d = c.offset().top, a[0] = [d, d + c.outerHeight()];
            for (var f = Q.offset().top, g = z.offset().top, j = g + z.outerHeight(), i = 0; i < Ma; i++) a.push([Math.max(g, Math.min(j, f + ra * i)), Math.max(g, Math.min(j, f + ra * (i + 1)))])
        });
        ma = new hb(ja);
        ya = new ib(function (a) {
            return B.eq(a)
        })
    }
    function wb() {
        function a(a) {
            var a = Ha(Ga(a, h.map(a, pa), f.visStart, f.visEnd)),
                b, c = a.length,
                d, e, g, j = [];
            for (b = 0; b < c; b++) {
                d = a[b];
                for (e = 0; e < d.length; e++) g = d[e], g.row = 0, g.level = b, j.push(g)
            }
            return j
        }
        function c(a) {
            return a.end ? o(a.end) : I(o(a.start), g("defaultEventMinutes"))
        }
        function b(a, b) {
            var c = "<",
                d = a.url,
                e = Za(a, g),
                f = e ? " style='" + e + "'" : "",
                h = ["fc-event", "fc-event-skin", "fc-event-vert"];
            n(a) && h.push("fc-event-draggable");
            b.isStart && h.push("fc-corner-top");
            b.isEnd && h.push("fc-corner-bottom");
            h = h.concat(a.className);
            a.source && (h = h.concat(a.source.className || []));
            c += d ? "a href='" + ca(a.url) + "'" : "div";
            c += " class='" + h.join(" ") + "' style='position:absolute;z-index:8;top:" + b.top + "px;left:" + b.left + "px;" + e + "'><div class='fc-event-inner fc-event-skin'" + f + "><div class='fc-event-head fc-event-skin'" + f + "><div class='fc-event-time'>" + ca(z(a.start, a.end, g("timeFormat"))) + "</div></div><div class='fc-event-content'><div class='fc-event-title'>" + ca(a.title) + "</div></div><div class='fc-event-bg'></div></div>";
            b.isEnd && i(a) && (c += "<div class='ui-resizable-handle ui-resizable-s'>=</div>");
            c += "</" + (d ? "a" : "div") + ">";
            return c
        }
        function e(a, b, c) {
            var d = b.find("div.fc-event-time");
            n(a) && l(a, b, d);
            c.isEnd && i(a) && j(a, b, d);
            q(a, b)
        }
        function d(a, b, c) {
            function d() {
                h || (b.width(e).height("").draggable("option", "grid", null), h = !0)
            }
            var e, f, h = !0,
                j, i = g("isRTL") ? -1 : 1,
                t = k(),
                l = A(),
                n = w(),
                m = x();
            b.draggable({
                zIndex: 9,
                opacity: g("dragOpacity", "month"),
                revertDuration: g("dragRevertDuration"),
                start: function (k, m) {
                    r("eventDragStart", b, a, k, m);
                    B(a, b);
                    e = b.width();
                    t.start(function (e, t, k, m) {
                        L();
                        e ? (f = !1, j = m * i, e.row ? c ? h && (b.width(l - 10), Va(b, n * Math.round((a.end ? (a.end - a.start) / xb : g("defaultEventMinutes")) / g("slotMinutes"))), b.draggable("option", "grid", [l, 1]), h = !1) : f = !0 : (D(u(o(a.start), j), u(pa(a), j)), d()), f = f || h && !j) : (d(), f = !0);
                        b.draggable("option", "revert", f)
                    }, k, "drag")
                },
                stop: function (c, e) {
                    t.stop();
                    L();
                    r("eventDragStop", b, a, c, e);
                    if (f) d(), b.css("filter", ""), G(a, b);
                    else {
                        var i = 0;
                        h || (i = Math.round((b.offset().top - F().offset().top) / n) * g("slotMinutes") + m - (a.start.getHours() * 60 + a.start.getMinutes()));
                        N(this, a, j, i, h, c, e)
                    }
                }
            })
        }
        function l(a, b, c) {
            function d(b) {
                var e = I(o(a.start), b),
                    f;
                a.end && (f = I(o(a.end), b));
                c.text(z(e, f, g("timeFormat")))
            }
            function e() {
                h && (c.css("display", ""), b.draggable("option", "grid", [p, x]), h = !1)
            }
            var f, h = !1,
                j, i, t, l = g("isRTL") ? -1 : 1,
                n = k(),
                m = R(),
                p = A(),
                x = w();
            b.draggable({
                zIndex: 9,
                scroll: !1,
                grid: [p, x],
                axis: m == 1 ? "y" : !1,
                opacity: g("dragOpacity"),
                revertDuration: g("dragRevertDuration"),
                start: function (d, k) {
                    r("eventDragStart", b, a, d, k);
                    B(a, b);
                    f = b.position();
                    i = t = 0;
                    n.start(function (d, f, i, t) {
                        b.draggable("option", "revert", !d);
                        L();
                        d && (j = t * l, g("allDaySlot") && !d.row ? (h || (h = !0, c.hide(), b.draggable("option", "grid", null)), D(u(o(a.start), j), u(pa(a), j))) : e())
                    }, d, "drag")
                },
                drag: function (a, b) {
                    i = Math.round((b.position.top - f.top) / x) * g("slotMinutes");
                    i != t && (h || d(i), t = i)
                },
                stop: function (c, g) {
                    var t = n.stop();
                    L();
                    r("eventDragStop", b, a, c, g);
                    t && (j || i || h) ? N(this, a, j, h ? 0 : i, h, c, g) : (e(), b.css("filter", ""), b.css(f), d(0), G(a, b))
                }
            })
        }
        function j(a, b, c) {
            var d, e, f = w();
            b.resizable({
                handles: {
                    s: "div.ui-resizable-s"
                },
                grid: f,
                start: function (c, f) {
                    d = e = 0;
                    B(a, b);
                    b.css("z-index", 9);
                    r("eventResizeStart", this, a, c, f)
                },
                resize: function (h, j) {
                    d = Math.round((Math.max(f, b.height()) - j.originalSize.height) / f);
                    d != e && (c.text(z(a.start, !d && !a.end ? null : I(v(a), g("slotMinutes") * d), g("timeFormat"))), e = d)
                },
                stop: function (c, e) {
                    r("eventResizeStop", this, a, c, e);
                    d ? O(this, a, 0, g("slotMinutes") * d, c, e) : (b.css("z-index", 8), G(a, b))
                }
            })
        }
        var f = this;
        f.renderEvents = function (d, j) {
            S(d);
            var i, l = d.length,
                k = [],
                n = [];
            for (i = 0; i < l; i++) d[i].allDay ? k.push(d[i]) : n.push(d[i]);
            g("allDaySlot") && (H(a(k), j), J());
            var l = R(),
                k = x(),
                p = K(),
                L = I(o(f.visStart), k),
                B = h.map(n, c),
                z, q, s, C, v, D;
            i = [];
            for (z = 0; z < l; z++) {
                s = q = Ha(Ga(n, B, L, I(o(L), p - k)));
                var N = D = v = C = void 0,
                    O = void 0,
                    w = void 0;
                for (C = s.length - 1; C > 0; C--) {
                    N = s[C];
                    for (v = 0; v < N.length; v++) {
                        O = N[v];
                        for (D = 0; D < s[C - 1].length; D++) if (w = s[C - 1][D], O.end > w.start && O.start < w.end) w.forward = Math.max(w.forward || 0, (O.forward || 0) + 1)
                    }
                }
                for (s = 0; s < q.length; s++) {
                    C = q[s];
                    for (v = 0; v < C.length; v++) D = C[v], D.col = z, D.level = s, i.push(D)
                }
                u(L, 1, !0)
            }
            var n = i.length,
                A, F, G;
            q = "";
            p = {};
            L = {};
            z = t();
            l = R();
            (s = g("isRTL")) ? (C = -1, N = l - 1) : (C = 1, N = 0);
            for (l = 0; l < n; l++) k = i[l], B = k.event, v = m(k.start, k.start), D = m(k.start, k.end), A = k.col, O = k.level, w = k.forward || 0, F = M(A * C + N), G = $(A * C + N) - F, G = Math.min(G - 6, G * 0.95), A = O ? G / (O + w + 1) : w ? (G / (w + 1) - 6) * 2 : G, O = F + G / (O + w + 1) * O * C + (s ? G - A : 0), k.top = v, k.left = O, k.outerWidth = A, k.outerHeight = D - v, q += b(B, k);
            z[0].innerHTML = q;
            s = z.children();
            for (l = 0; l < n; l++) k = i[l], B = k.event, q = h(s[l]), C = r("eventRender", B, B, q), C === !1 ? q.remove() : (C && C !== !0 && (q.remove(), q = h(C).css({
                position: "absolute",
                top: k.top,
                left: k.left
            }).appendTo(z)), k.element = q, B._id === j ? e(B, q, k) : q[0]._fci = l, E(B, q));
            Ua(z, i, e);
            for (l = 0; l < n; l++) if (k = i[l], q = k.element) if (z = p[B = k.key = Ya(q[0])], k.vsides = z === y ? p[B] = na(q, !0) : z, z = L[B], k.hsides = z === y ? L[B] = Ia(q, !0) : z, B = q.find("div.fc-event-content"), B.length) k.contentTop = B[0].offsetTop;
            for (l = 0; l < n; l++) if (k = i[l], q = k.element) q[0].style.width = Math.max(0, k.outerWidth - k.hsides) + "px", p = Math.max(0, k.outerHeight - k.vsides), q[0].style.height = p + "px", B = k.event, k.contentTop !== y && p - k.contentTop < 10 && (q.find("div.fc-event-time").text(da(B.start, g("timeFormat")) + " - " + B.title), q.find("div.fc-event-title").remove()), r("eventAfterRender", B, B, q)
        };
        f.compileDaySegs = a;
        f.clearEvents = function () {
            s();
            p().empty();
            t().empty()
        };
        f.slotSegHtml = b;
        f.bindDaySeg = function (a, b, c) {
            n(a) && d(a, b, c.isStart);
            c.isEnd && i(a) && U(a, b, c);
            q(a, b)
        };
        jb.call(f);
        var g = f.opt,
            r = f.trigger,
            n = f.isEventDraggable,
            i = f.isEventResizable,
            v = f.eventEnd,
            S = f.reportEvents,
            s = f.reportEventClear,
            q = f.eventElementHandlers,
            J = f.setHeight,
            p = f.getDaySegmentContainer,
            t = f.getSlotSegmentContainer,
            k = f.getHoverListener,
            K = f.getMaxMinute,
            x = f.getMinMinute,
            m = f.timePosition,
            M = f.colContentLeft,
            $ = f.colContentRight,
            H = f.renderDaySegs,
            U = f.resizableDayEvent,
            R = f.getColCnt,
            A = f.getColWidth,
            w = f.getSlotHeight,
            F = f.getBodyContent,
            E = f.reportEventElement,
            G = f.showEvents,
            B = f.hideEvents,
            N = f.eventDrop,
            O = f.eventResize,
            D = f.renderDayOverlay,
            L = f.clearOverlays,
            C = f.calendar,
            da = C.formatDate,
            z = C.formatDates
    }
    function db(a, c, b) {
        function e(a, c) {
            var d = p[a];
            return typeof d == "object" ? Ca(d, c || b) : d
        }
        function d(a, b) {
            return c.trigger.apply(c, [a, b || n].concat(Array.prototype.slice.call(arguments, 2), [n]))
        }
        function h(a) {
            return oa(a.editable, (a.source || {}).editable, e("editable"))
        }
        function j(a) {
            return a.end ? o(a.end) : i(a)
        }
        function f(a, b, c) {
            var a = J[a._id],
                d, e = a.length;
            for (d = 0; d < e; d++) if (!b || a[d][0] != b[0]) a[d][c]()
        }
        function g(a, b, c, d) {
            for (var c = c || 0, e, f = a.length, g = 0; g < f; g++) {
                e = a[g];
                if (d !== y) e.allDay = d;
                I(u(e.start, b, !0), c);
                if (e.end) e.end = I(u(e.end, b, !0), c);
                v(e, p)
            }
        }
        function r(a, b, c) {
            for (var c = c || 0, d, e = a.length, f = 0; f < e; f++) d = a[f], d.end = I(u(j(d), b, !0), c), v(d, p)
        }
        var n = this;
        n.element = a;
        n.calendar = c;
        n.name = b;
        n.opt = e;
        n.trigger = d;
        n.isEventDraggable = function (a) {
            return h(a) && !e("disableDragging")
        };
        n.isEventResizable = function (a) {
            return h(a) && !e("disableResizing")
        };
        n.reportEvents = function (a) {
            s = {};
            var b, c = a.length,
                d;
            for (b = 0; b < c; b++) d = a[b], s[d._id] ? s[d._id].push(d) : s[d._id] = [d]
        };
        n.eventEnd = j;
        n.reportEventElement = function (a, b) {
            q.push(b);
            J[a._id] ? J[a._id].push(b) : J[a._id] = [b]
        };
        n.reportEventClear = function () {
            q = [];
            J = {}
        };
        n.eventElementHandlers = function (a, b) {
            b.click(function (c) {
                if (!b.hasClass("ui-draggable-dragging") && !b.hasClass("ui-resizable-resizing")) return d("eventClick", this, a, c)
            }).hover(function (b) {
                d("eventMouseover", this, a, b)
            }, function (b) {
                d("eventMouseout", this, a, b)
            })
        };
        n.showEvents = function (a, b) {
            f(a, b, "show")
        };
        n.hideEvents = function (a, b) {
            f(a, b, "hide")
        };
        n.eventDrop = function (a, b, c, e, f, h, i) {
            var j = b.allDay,
                l = b._id;
            g(s[l], c, e, f);
            d("eventDrop", a, b, c, e, f, function () {
                g(s[l], -c, -e, j);
                S(l)
            }, h, i);
            S(l)
        };
        n.eventResize = function (a, b, c, e, f, g) {
            var h = b._id;
            r(s[h], c, e);
            d("eventResize", a, b, c, e, function () {
                r(s[h], -c, -e);
                S(h)
            }, f, g);
            S(h)
        };
        var i = n.defaultEventEnd,
            v = c.normalizeEvent,
            S = c.reportEventChange,
            s = {},
            q = [],
            J = {},
            p = c.options
    }
    function jb() {
        function a(a) {
            var b = r("isRTL"),
                c, d = a.length,
                e, f, g, h;
            c = x();
            var j = c.left,
                l = c.right,
                k, n, q, p, o, s = "";
            for (c = 0; c < d; c++) e = a[c], f = e.event, h = ["fc-event", "fc-event-skin", "fc-event-hori"], i(f) && h.push("fc-event-draggable"), b ? (e.isStart && h.push("fc-corner-right"), e.isEnd && h.push("fc-corner-left"), k = H(e.end.getDay() - 1), n = H(e.start.getDay()), q = e.isEnd ? m(k) : j, p = e.isStart ? I(n) : l) : (e.isStart && h.push("fc-corner-left"), e.isEnd && h.push("fc-corner-right"), k = H(e.start.getDay()), n = H(e.end.getDay() - 1), q = e.isStart ? m(k) : j, p = e.isEnd ? I(n) : l), h = h.concat(f.className), f.source && (h = h.concat(f.source.className || [])), g = f.url, o = Za(f, r), s += g ? "<a href='" + ca(g) + "'" : "<div", s += " class='" + h.join(" ") + "' style='position:absolute;z-index:8;left:" + q + "px;" + o + "'><div class='fc-event-inner fc-event-skin'" + (o ? " style='" + o + "'" : "") + ">", !f.allDay && e.isStart && (s += "<span class='fc-event-time'>" + ca(w(f.start, f.end, r("timeFormat"))) + "</span>"), s += "<span class='fc-event-title'>" + ca(f.title) + "</span></div>", e.isEnd && v(f) && (s += "<div class='ui-resizable-handle ui-resizable-" + (b ? "w" : "e") + "'>&nbsp;&nbsp;&nbsp;</div>"), s += "</" + (g ? "a" : "div") + ">", e.left = q, e.outerWidth = p - q, e.startCol = k, e.endCol = n + 1;
            return s
        }
        function c(a, b) {
            var c, d = a.length,
                e, f, g;
            for (c = 0; c < d; c++) e = a[c], f = e.event, g = h(b[c]), f = n("eventRender", f, f, g), f === !1 ? g.remove() : (f && f !== !0 && (f = h(f).css({
                position: "absolute",
                left: e.left
            }), g.replaceWith(f), g = f), e.element = g)
        }
        function b(a) {
            var b, c = a.length,
                d, e, f, g, h = {};
            for (b = 0; b < c; b++) if (d = a[b], e = d.element) f = d.key = Ya(e[0]), g = h[f], g === y && (g = h[f] = Ia(e, !0)), d.hsides = g
        }
        function e(a) {
            var b, c = a.length,
                d, e;
            for (b = 0; b < c; b++) if (d = a[b], e = d.element) e[0].style.width = Math.max(0, d.outerWidth - d.hsides) + "px"
        }
        function d(a) {
            var b, c = a.length,
                d, e, f, g, h = {};
            for (b = 0; b < c; b++) if (d = a[b], e = d.element) f = d.key, g = h[f], g === y && (g = h[f] = Wa(e)), d.outerHeight = e[0].offsetHeight + g
        }
        function l() {
            var a, b = t(),
                c = [];
            for (a = 0; a < b; a++) c[a] = K(a).find("td:first div.fc-day-content > div");
            return c
        }
        function j(a) {
            var b, c = a.length,
                d = [];
            for (b = 0; b < c; b++) d[b] = a[b][0].offsetTop;
            return d
        }
        function f(a, b) {
            var c, d = a.length,
                e, f;
            for (c = 0; c < d; c++) if (e = a[c], f = e.element) f[0].style.top = b[e.row] + (e.top || 0) + "px", e = e.event, n("eventAfterRender", e, e, f)
        }
        var g = this;
        g.renderDaySegs = function (g, h) {
            var i = R(),
                n = t(),
                q = k(),
                p = 0,
                o, r, m, v = g.length,
                u, x;
            i[0].innerHTML = a(g);
            c(g, i.children());
            r = g.length;
            for (o = 0; o < r; o++) m = g[o], (x = m.element) && s(m.event, x);
            r = g.length;
            var w;
            for (o = 0; o < r; o++) if (m = g[o], x = m.element) w = m.event, w._id === h ? A(w, x, m) : x[0]._fci = o;
            Ua(i, g, A);
            b(g);
            e(g);
            d(g);
            i = l();
            for (o = 0; o < n; o++) {
                r = [];
                for (m = 0; m < q; m++) r[m] = 0;
                for (; p < v && (u = g[p]).row == o;) {
                    m = r.slice(u.startCol, u.endCol);
                    m = Math.max.apply(Math, m);
                    u.top = m;
                    m += u.outerHeight;
                    for (x = u.startCol; x < u.endCol; x++) r[x] = m;
                    p++
                }
                i[o].height(Math.max.apply(Math, r))
            }
            f(g, j(i))
        };
        g.resizableDayEvent = function (i, m, s) {
            var v = r("isRTL"),
                x = v ? "w" : "e",
                w = m.find("div.ui-resizable-" + x),
                y = !1;
            Ja(m);
            m.mousedown(function (a) {
                a.preventDefault()
            }).click(function (a) {
                y && (a.preventDefault(), a.stopImmediatePropagation())
            });
            w.mousedown(function (r) {
                if (r.which == 1) {
                    y = !0;
                    var w = g.getHoverListener(),
                        A = t(),
                        C = k(),
                        H = v ? -1 : 1,
                        I = v ? C - 1 : 0,
                        K = m.css("top"),
                        P, M, T = h.extend({}, i),
                        X = V(i.start);
                    G();
                    h("body").css("cursor", x + "-resize").one("mouseup", function (a) {
                        n("eventResizeStop", this, i, a);
                        h("body").css("cursor", "");
                        w.stop();
                        E();
                        P && p(this, i, P, 0, a);
                        setTimeout(function () {
                            y = !1
                        }, 0)
                    });
                    n("eventResizeStart", this, i, r);
                    w.start(function (g, k) {
                        if (g) {
                            var n = Math.max(X.row, g.row),
                                m = g.col;
                            A == 1 && (n = 0);
                            n == X.row && (m = v ? Math.min(X.col, m) : Math.max(X.col, m));
                            P = n * 7 + m * H + I - (k.row * 7 + k.col * H + I);
                            n = u(S(i), P, !0);
                            if (P) {
                                T.end = n;
                                var m = M,
                                    r = U([T]),
                                    p = s.row,
                                    t = h("<div/>"),
                                    w = R(),
                                    y = r.length,
                                    z;
                                t[0].innerHTML = a(r);
                                t = t.children();
                                w.append(t);
                                c(r, t);
                                b(r);
                                e(r);
                                d(r);
                                f(r, j(l()));
                                t = [];
                                for (w = 0; w < y; w++) if (z = r[w].element) r[w].row === p && z.css("top", K), t.push(z[0]);
                                M = h(t);
                                M.find("*").css("cursor", x + "-resize");
                                m && m.remove();
                                J(i)
                            } else M && (q(i), M.remove(), M = null);
                            E();
                            F(i.start, u(o(n), 1))
                        }
                    }, r)
                }
            })
        };
        var r = g.opt,
            n = g.trigger,
            i = g.isEventDraggable,
            v = g.isEventResizable,
            S = g.eventEnd,
            s = g.reportEventElement,
            q = g.showEvents,
            J = g.hideEvents,
            p = g.eventResize,
            t = g.getRowCnt,
            k = g.getColCnt,
            K = g.allDayRow,
            x = g.allDayBounds,
            m = g.colContentLeft,
            I = g.colContentRight,
            H = g.dayOfWeekCol,
            V = g.dateCell,
            U = g.compileDaySegs,
            R = g.getDaySegmentContainer,
            A = g.bindDaySeg,
            w = g.calendar.formatDates,
            F = g.renderDayOverlay,
            E = g.clearOverlays,
            G = g.clearSelection
    }
    function fb() {
        function a(a) {
            g && (g = !1, f(), d("unselect", null, a))
        }
        function c(a, b, c, e) {
            g = !0;
            d("select", null, a, b, c, e)
        }
        var b = this;
        b.select = function (b, d, e) {
            a();
            d || (d = l(b, e));
            j(b, d, e);
            c(b, d, e)
        };
        b.unselect = a;
        b.reportSelection = c;
        b.daySelectionMousedown = function (d) {
            var g = b.cellDate,
                i = b.cellIsAllDay,
                l = b.getHoverListener(),
                o = b.reportDayClick;
            if (d.which == 1 && e("selectable")) {
                a(d);
                var s;
                l.start(function (a, b) {
                    f();
                    a && i(a) ? (s = [g(b), g(a)].sort(Xa), j(s[0], s[1], !0)) : s = null
                }, d);
                h(document).one("mouseup", function (a) {
                    l.stop();
                    s && (+s[0] == +s[1] && o(s[0], !0, a), c(s[0], s[1], !0, a))
                })
            }
        };
        var e = b.opt,
            d = b.trigger,
            l = b.defaultSelectionEnd,
            j = b.renderSelection,
            f = b.clearSelection,
            g = !1;
        e("selectable") && e("unselectAuto") && h(document).mousedown(function (b) {
            var c = e("unselectCancel");
            (!c || !h(b.target).parents(c).length) && a(b)
        })
    }
    function eb() {
        this.renderOverlay = function (b, e) {
            var d = c.shift();
            d || (d = h("<div class='fc-cell-overlay' style='position:absolute;z-index:3'/>"));
            d[0].parentNode != e[0] && d.appendTo(e);
            a.push(d.css(b).show());
            return d
        };
        this.clearOverlays = function () {
            for (var b; b = a.shift();) c.push(b.hide().unbind())
        };
        var a = [],
            c = []
    }
    function gb(a) {
        var c, b;
        this.build = function () {
            c = [];
            b = [];
            a(c, b)
        };
        this.cell = function (a, d) {
            var h = c.length,
                j = b.length,
                f, g = -1,
                o = -1;
            for (f = 0; f < h; f++) if (d >= c[f][0] && d < c[f][1]) {
                g = f;
                break
            }
            for (f = 0; f < j; f++) if (a >= b[f][0] && a < b[f][1]) {
                o = f;
                break
            }
            return g >= 0 && o >= 0 ? {
                row: g,
                col: o
            } : null
        };
        this.rect = function (a, d, h, j, f) {
            f = f.offset();
            return {
                top: c[a][0] - f.top,
                left: b[d][0] - f.left,
                width: b[j][1] - b[d][0],
                height: c[h][1] - c[a][0]
            }
        }
    }

    function hb(a) {
        function c(b) {
            b = a.cell(b.pageX, b.pageY);
            if (!b != !l || b && (b.row != l.row || b.col != l.col)) b ? (d || (d = b), e(b, d, b.row - d.row, b.col - d.col)) : e(b, d), l = b
        }
        var b, e, d, l;
        this.start = function (j, f, g) {
            e = j;
            d = l = null;
            a.build();
            c(f);
            b = g || "mousemove";
            h(document).bind(b, c)
        };
        this.stop = function () {
            h(document).unbind(b, c);
            return l
        }
    }
    function ib(a) {
        var c = this,
            b = {},
            e = {},
            d = {};
        c.left = function (c) {
            return e[c] = e[c] === y ? (b[c] = b[c] || a(c)).position().left : e[c]
        };
        c.right = function (e) {
            return d[e] = d[e] === y ? c.left(e) + (b[e] = b[e] || a(e)).width() : d[e]
        };
        c.clear = function () {
            b = {};
            e = {};
            d = {}
        }
    }
    var ta = {
        defaultView: "month",
        aspectRatio: 1.35,
        header: {
            left: "title",
            center: "",
            right: "today prev,next"
        },
        weekends: !0,
        allDayDefault: !0,
        ignoreTimezone: !0,
        lazyFetching: !0,
        startParam: "start",
        endParam: "end",
        titleFormat: {
            month: "MMMM yyyy",
            week: "MMM d[ yyyy]{ '&#8212;'[ MMM] d yyyy}",
            day: "dddd, MMM d, yyyy"
        },
        columnFormat: {
            month: "ddd",
            week: "ddd M/d",
            day: "dddd M/d"
        },
        timeFormat: {
            "": "h(:mm)t"
        },
        isRTL: !1,
        firstDay: 0,
        monthNames: "January,February,March,April,May,June,July,August,September,October,November,December".split(","),
        monthNamesShort: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),
        dayNames: "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),
        dayNamesShort: "Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),
        buttonText: {
            prev: "&nbsp;&#9668;&nbsp;",
            next: "&nbsp;&#9658;&nbsp;",
            prevYear: "&nbsp;&lt;&lt;&nbsp;",
            nextYear: "&nbsp;&gt;&gt;&nbsp;",
            today: "today",
            month: "month",
            week: "week",
            day: "day"
        },
        theme: !1,
        buttonIcons: {
            prev: "circle-triangle-w",
            next: "circle-triangle-e"
        },
        unselectAuto: !0,
        dropAccept: "*"
    },
        yb = {
            header: {
                left: "next,prev today",
                center: "",
                right: "title"
            },
            buttonText: {
                prev: "&nbsp;&#9658;&nbsp;",
                next: "&nbsp;&#9668;&nbsp;",
                prevYear: "&nbsp;&gt;&gt;&nbsp;",
                nextYear: "&nbsp;&lt;&lt;&nbsp;"
            },
            buttonIcons: {
                prev: "circle-triangle-e",
                next: "circle-triangle-w"
            }
        },
        H = h.fullCalendar = {
            version: "1.5.2"
        },
        Z = H.views = {};
    h.fn.fullCalendar = function (a) {
        if (typeof a == "string") {
            var c = Array.prototype.slice.call(arguments, 1),
                b;
            this.each(function () {
                var d = h.data(this, "fullCalendar");
                d && h.isFunction(d[a]) && (d = d[a].apply(d, c), b === y && (b = d), a == "destroy" && h.removeData(this, "fullCalendar"))
            });
            return b !== y ? b : this
        }
        var e = a.eventSources || [];
        delete a.eventSources;
        a.events && (e.push(a.events), delete a.events);
        a = h.extend(!0, {}, ta, a.isRTL || a.isRTL === y && ta.isRTL ? yb : {}, a);
        this.each(function (b, c) {
            var j = h(c),
                f = new mb(j, a, e);
            j.data("fullCalendar", f);
            f.render()
        });
        return this
    };
    H.sourceNormalizers = [];
    H.sourceFetchers = [];
    var pb = {
        dataType: "json",
        cache: !1
    },
        qb = 1;
    H.addDays = u;
    H.cloneDate = o;
    H.parseDate = Da;
    H.parseISO8601 = Ta;
    H.parseTime = Fa;
    H.formatDate = ba;
    H.formatDates = Ba;
    var ub = "sun,mon,tue,wed,thu,fri,sat".split(","),
        Sa = 864E5,
        rb = 36E5,
        xb = 6E4,
        sb = {
            s: function (a) {
                return a.getSeconds()
            },
            ss: function (a) {
                return Y(a.getSeconds())
            },
            m: function (a) {
                return a.getMinutes()
            },
            mm: function (a) {
                return Y(a.getMinutes())
            },
            h: function (a) {
                return a.getHours() % 12 || 12
            },
            hh: function (a) {
                return Y(a.getHours() % 12 || 12)
            },
            H: function (a) {
                return a.getHours()
            },
            HH: function (a) {
                return Y(a.getHours())
            },
            d: function (a) {
                return a.getDate()
            },
            dd: function (a) {
                return Y(a.getDate())
            },
            ddd: function (a, c) {
                return c.dayNamesShort[a.getDay()]
            },
            dddd: function (a, c) {
                return c.dayNames[a.getDay()]
            },
            M: function (a) {
                return a.getMonth() + 1
            },
            MM: function (a) {
                return Y(a.getMonth() + 1)
            },
            MMM: function (a, c) {
                return c.monthNamesShort[a.getMonth()]
            },
            MMMM: function (a, c) {
                return c.monthNames[a.getMonth()]
            },
            yy: function (a) {
                return (a.getFullYear() + "").substring(2)
            },
            yyyy: function (a) {
                return a.getFullYear()
            },
            t: function (a) {
                return a.getHours() < 12 ? "a" : "p"
            },
            tt: function (a) {
                return a.getHours() < 12 ? "am" : "pm"
            },
            T: function (a) {
                return a.getHours() < 12 ? "A" : "P"
            },
            TT: function (a) {
                return a.getHours() < 12 ? "AM" : "PM"
            },
            u: function (a) {
                return ba(a, "yyyy-MM-dd'T'HH:mm:ss'Z'")
            },
            S: function (a) {
                a = a.getDate();
                return a > 10 && a < 20 ? "th" : ["st", "nd", "rd"][a % 10 - 1] || "th"
            }
        };
    H.applyAll = va;
    Z.month = function (a, c) {
        var b = this;
        b.render = function (a, c) {
            c && (Aa(a, c), a.setDate(1));
            var g = o(a, !0);
            g.setDate(1);
            var r = Aa(o(g), 1),
                n = o(g),
                i = o(r),
                v = e("firstDay"),
                y = e("weekends") ? 0 : 1;
            y && (V(n), V(i, -1, !0));
            u(n, -((n.getDay() - Math.max(v, y) + 7) % 7));
            u(i, (7 - i.getDay() + Math.max(v, y)) % 7);
            v = Math.round((i - n) / (Sa * 7));
            e("weekMode") == "fixed" && (u(i, (6 - v) * 7), v = 6);
            b.title = h(g, e("titleFormat"));
            b.start = g;
            b.end = r;
            b.visStart = n;
            b.visEnd = i;
            d(6, v, y ? 5 : 7, !0)
        };
        La.call(b, a, c, "month");
        var e = b.opt,
            d = b.renderBasic,
            h = c.formatDate
    };
    Z.basicWeek = function (a, c) {
        var b = this;
        b.render = function (a, c) {
            c && u(a, c * 7);
            var g = u(o(a), -((a.getDay() - e("firstDay") + 7) % 7)),
                r = u(o(g), 7),
                n = o(g),
                i = o(r),
                v = e("weekends");
            v || (V(n), V(i, -1, !0));
            b.title = h(n, u(o(i), -1), e("titleFormat"));
            b.start = g;
            b.end = r;
            b.visStart = n;
            b.visEnd = i;
            d(1, 1, v ? 7 : 5, !1)
        };
        La.call(b, a, c, "basicWeek");
        var e = b.opt,
            d = b.renderBasic,
            h = c.formatDates
    };
    Z.basicDay = function (a, c) {
        var b = this;
        b.render = function (a, c) {
            c && (u(a, c), e("weekends") || V(a, c < 0 ? -1 : 1));
            b.title = h(a, e("titleFormat"));
            b.start = b.visStart = o(a, !0);
            b.end = b.visEnd = u(o(b.start), 1);
            d(1, 1, 1, !1)
        };
        La.call(b, a, c, "basicDay");
        var e = b.opt,
            d = b.renderBasic,
            h = c.formatDate
    };
    Oa({
        weekMode: "fixed"
    });
    Z.agendaWeek = function (a, c) {
        var b = this;
        b.render = function (a, c) {
            c && u(a, c * 7);
            var g = u(o(a), -((a.getDay() - e("firstDay") + 7) % 7)),
                r = u(o(g), 7),
                n = o(g),
                i = o(r),
                v = e("weekends");
            v || (V(n), V(i, -1, !0));
            b.title = h(n, u(o(i), -1), e("titleFormat"));
            b.start = g;
            b.end = r;
            b.visStart = n;
            b.visEnd = i;
            d(v ? 7 : 5)
        };
        kb.call(b, a, c, "agendaWeek");
        var e = b.opt,
            d = b.renderAgenda,
            h = c.formatDates
    };
    Z.agendaDay = function (a, c) {
        var b = this;
        b.render = function (a, c) {
            c && (u(a, c), e("weekends") || V(a, c < 0 ? -1 : 1));
            var g = o(a, !0),
                r = u(o(g), 1);
            b.title = h(a, e("titleFormat"));
            b.start = b.visStart = g;
            b.end = b.visEnd = r;
            d(1)
        };
        kb.call(b, a, c, "agendaDay");
        var e = b.opt,
            d = b.renderAgenda,
            h = c.formatDate
    };
    Oa({
        allDaySlot: !0,
        allDayText: "all-day",
        firstHour: 6,
        slotMinutes: 30,
        defaultEventMinutes: 120,
        axisFormat: "h(:mm)tt",
        timeFormat: {
            agenda: "h:mm{ - h:mm}"
        },
        dragOpacity: {
            agenda: 0.5
        },
        minTime: 0,
        maxTime: 24
    })
})(jQuery);
(function (a) {
    var l = {
        buttons: {
            button1: {
                text: "OK",
                danger: !1,
                onclick: function () {
                    a.fallr("hide")
                }
            }
        },
        icon: "check",
        content: "Hello",
        position: "top",
        closeKey: !1,
        closeOverlay: !1,
        useOverlay: !0,
        autoclose: !1,
        easingDuration: 300,
        easingIn: "swing",
        easingOut: "swing",
        height: "auto",
        width: "360px",
        zIndex: 100
    },
        d, n, f = a(window),
        g = {
            hide: function (b, j, i) {
                if (g.isActive()) {
                    a("#fallr-wrapper").stop(!0, !0);
                    var c = a("#fallr-wrapper"),
                        b = c.css("position"),
                        h = 0;
                    switch (d.position) {
                    case "bottom":
                    case "center":
                        h = (b === "fixed" ? f.height() : c.offset().top + c.height()) + 10;
                        break;
                    default:
                        h = (b === "fixed" ? -1 * c.outerHeight() : c.offset().top) - 10
                    }
                    c.animate({
                        top: h
                    }, d.easingDuration || d.duration, d.easingOut, function () {
                        a.browser.msie ? a("#fallr-overlay").css("display", "none") : a("#fallr-overlay").fadeOut("fast");
                        c.remove();
                        clearTimeout(n);
                        typeof j === "function" && j.call(i)
                    });
                    a(document).unbind("keydown", e.enterKeyHandler).unbind("keydown", e.closeKeyHandler).unbind("keydown", e.tabKeyHandler)
                }
            },
            resize: function (b, d, f) {
                var c = a("#fallr-wrapper"),
                    h = parseInt(b.width, 10),
                    m = parseInt(b.height, 10),
                    b = Math.abs(c.outerWidth() - h),
                    o = Math.abs(c.outerHeight() - m);
                if (g.isActive() && (b > 5 || o > 5)) c.animate({
                    width: h
                }, function () {
                    a(this).animate({
                        height: m
                    }, function () {
                        e.fixPos()
                    })
                }), a("#fallr").animate({
                    width: h - 94
                }, function () {
                    a(this).animate({
                        height: m - 131
                    }, function () {
                        typeof d === "function" && d.call(f)
                    })
                })
            },
            show: function (b, j, i) {
                if (g.isActive()) a.error("Can't create new message with content: \"" + b.content + '", past message with content "' + d.content + '" is still active');
                else {
                    d = a.extend({}, l, b);
                    a('<div id="fallr-wrapper"></div>').appendTo("body");
                    var c = a("#fallr-wrapper"),
                        h = a("#fallr-overlay");
                    c.css({
                        width: d.width,
                        height: d.height,
                        position: "absolute",
                        top: "-9999px",
                        left: "-9999px"
                    }).html('<div id="fallr-icon"></div><div id="fallr"></div><div id="fallr-buttons"></div>').find("#fallr-icon").addClass("icon-" + d.icon).end().find("#fallr").html(d.content).css({
                        height: d.height == "auto" ? "auto" : c.height() - 131,
                        width: c.width() - 94
                    }).end().find("#fallr-buttons").html(function () {
                        var a = "",
                            b;
                        for (b in d.buttons) d.buttons.hasOwnProperty(b) && (a = a + '<a href="#" class="fallr-button ' + (d.buttons[b].danger ? "fallr-button-danger" : "") + '" id="fallr-button-' + b + '">' + d.buttons[b].text + "</a>");
                        return a
                    }()).find(".fallr-button").bind("click", function () {
                        var b = a(this).attr("id").substring(13);
                        if (typeof d.buttons[b].onclick === "function" && d.buttons[b].onclick != !1) {
                            var c = document.getElementById("fallr");
                            d.buttons[b].onclick.apply(c)
                        } else g.hide();
                        return !1
                    });
                    b = function () {
                        c.show();
                        var b = (f.width() - c.outerWidth()) / 2 + f.scrollLeft(),
                            a, e, k = f.height() > c.height() && f.width() > c.width() ? "fixed" : "absolute";
                        switch (d.position) {
                        case "bottom":
                            a = k === "fixed" ? f.height() : f.scrollTop() + f.height();
                            e = a - c.outerHeight();
                            break;
                        case "center":
                            a = k === "fixed" ? -1 * c.outerHeight() : h.offset().top - c.outerHeight();
                            e = a + c.outerHeight() + (f.height() - c.outerHeight()) / 2;
                            break;
                        default:
                            e = k === "fixed" ? 0 : f.scrollTop(), a = e - c.outerHeight()
                        }
                        c.css({
                            left: b,
                            position: k,
                            top: a,
                            "z-index": d.zIndex + 1
                        }).animate({
                            top: e
                        }, d.easingDuration, d.easingIn, function () {
                            typeof j === "function" && j.call(i);
                            d.autoclose && (n = setTimeout(g.hide, d.autoclose))
                        })
                    };
                    d.useOverlay ? a.browser.msie && a.browser.version < 9 ? (h.css({
                        display: "block",
                        "z-index": d.zIndex
                    }), b()) : h.css({
                        "z-index": d.zIndex
                    }).fadeIn(b) : b();
                    a(document).bind("keydown", e.enterKeyHandler).bind("keydown", e.closeKeyHandler).bind("keydown", e.tabKeyHandler);
                    a("#fallr-buttons").children().eq(-1).bind("focus", function () {
                        a(this).bind("keydown", e.tabKeyHandler)
                    });
                    c.find(":input").bind("keydown", function (b) {
                        e.unbindKeyHandler();
                        b.keyCode === 13 && (console.log(1), a(".fallr-button").eq(0).trigger("click"))
                    })
                }
            },
            set: function (b, a, e) {
                for (var c in b) l.hasOwnProperty(c) && (l[c] = b[c], d && d[c] && (d[c] = b[c]));
                typeof a === "function" && a.call(e)
            },
            isActive: function () {
                return !!(a("#fallr-wrapper").length > 0)
            },
            blink: function () {
                a("#fallr-wrapper").fadeOut(100, function () {
                    a(this).fadeIn(100)
                })
            },
            shake: function () {
                a("#fallr-wrapper").stop(!0, !0).animate({
                    left: "+=20px"
                }, 50, function () {
                    a(this).animate({
                        left: "-=40px"
                    }, 50, function () {
                        a(this).animate({
                            left: "+=30px"
                        }, 50, function () {
                            a(this).animate({
                                left: "-=20px"
                            }, 50, function () {
                                a(this).animate({
                                    left: "+=10px"
                                }, 50)
                            })
                        })
                    })
                })
            }
        },
        e = {
            fixPos: function () {
                var b = a("#fallr-wrapper"),
                    e = b.css("position");
                if (f.width() > b.outerWidth() && f.height() > b.outerHeight()) {
                    var i = (f.width() - b.outerWidth()) / 2,
                        c = f.height() - b.outerHeight();
                    switch (d.position) {
                    case "center":
                        c /= 2;
                        break;
                    case "bottom":
                        break;
                    default:
                        c = 0
                    }
                    e == "fixed" ? b.animate({
                        left: i
                    }, function () {
                        a(this).animate({
                            top: c
                        })
                    }) : b.css({
                        position: "fixed",
                        left: i,
                        top: c
                    })
                } else i = (f.width() - b.outerWidth()) / 2 + f.scrollLeft(), c = f.scrollTop(), e != "fixed" ? b.animate({
                    left: i
                }, function () {
                    a(this).animate({
                        top: c
                    })
                }) : b.css({
                    position: "absolute",
                    top: c,
                    left: i > 0 ? i : 0
                })
            },
            enterKeyHandler: function (b) {
                b.keyCode === 13 && (a("#fallr-buttons").children().eq(0).focus(), e.unbindKeyHandler())
            },
            tabKeyHandler: function (b) {
                b.keyCode === 9 && (a("#fallr-wrapper").find(":input, .fallr-button").eq(0).focus(), e.unbindKeyHandler(), b.preventDefault())
            },
            closeKeyHandler: function (a) {
                a.keyCode === 27 && d.closeKey && g.hide()
            },
            unbindKeyHandler: function () {
                a(document).unbind("keydown", e.enterKeyHandler).unbind("keydown", e.tabKeyHandler)
            }
        };
    a(document).ready(function () {
        a("body").append('<div id="fallr-overlay"></div>');
        a("#fallr-overlay").bind("click", function () {
            d.closeOverlay ? g.hide() : g.blink()
        })
    });
    a(window).resize(function () {
        g.isActive() && e.fixPos()
    });
    a.fallr = function (b, d, e) {
        var c = window;
        typeof b === "object" && (d = b, b = "show");
        g[b] ? (typeof d === "function" && (e = d, d = null), g[b](d, e, c)) : a.error('Method "' + b + '" does not exist in $.fallr')
    }
})(jQuery);
(function ($, h, c) {
    var a = $([]),
        e = $.resize = $.extend($.resize, {}),
        i, k = "setTimeout",
        j = "resize",
        d = j + "-special-event",
        b = "delay",
        f = "throttleWindow";
    e[b] = 250;
    e[f] = true;
    $.event.special[j] = {
        setup: function () {
            if (!e[f] && this[k]) {
                return false
            }
            var l = $(this);
            a = a.add(l);
            $.data(this, d, {
                w: l.width(),
                h: l.height()
            });
            if (a.length === 1) {
                g()
            }
        },
        teardown: function () {
            if (!e[f] && this[k]) {
                return false
            }
            var l = $(this);
            a = a.not(l);
            l.removeData(d);
            if (!a.length) {
                clearTimeout(i)
            }
        },
        add: function (l) {
            if (!e[f] && this[k]) {
                return false
            }
            var n;

            function m(s, o, p) {
                var q = $(this),
                    r = $.data(this, d);
                if (r === c) {
                    r = $.data(document, d)
                }
                r.w = o !== c ? o : q.width();
                r.h = p !== c ? p : q.height();
                n.apply(this, arguments)
            }
            if ($.isFunction(l)) {
                n = l;
                return m
            } else {
                n = l.handler;
                l.handler = m
            }
        }
    };

    function g() {
        i = h[k](function () {
            a.each(function () {
                var n = $(this),
                    m = n.width(),
                    l = n.height(),
                    o = $.data(this, d);
                if (m !== o.w || l !== o.h) {
                    n.trigger(j, [o.w = m, o.h = l])
                }
            });
            g()
        }, e[b])
    }
})(jQuery, this);
(function (g) {
    var h = function (e) {
            if (!e) e = window.event;
            e.cancelBubble = !0;
            e.stopPropagation && e.stopPropagation()
        };
    g.fn.checkbox = function (e) {
        try {
            document.execCommand("BackgroundImageCache", !1, !0)
        } catch (j) {}
        var b = {
            cls: "jquery-checkbox",
            empty: "empty.png"
        },
            b = g.extend(b, e || {}),
            i = function (a) {
                var b = a.checked,
                    c = a.disabled,
                    f = g(a);
                a.stateInterval && clearInterval(a.stateInterval);
                a.stateInterval = setInterval(function () {
                    a.disabled != c && f.trigger((c = !! a.disabled) ? "disable" : "enable");
                    a.checked != b && f.trigger((b = !! a.checked) ? "check" : "uncheck")
                }, 10);
                return f
            };
        return this.each(function () {
            var a = this,
                d = i(a);
            a.wrapper && a.wrapper.remove();
            a.wrapper = g('<span class="' + b.cls + '"><span class="mark"><img src="' + b.empty + '" /></span></span>');
            a.wrapperInner = a.wrapper.children("span:eq(0)");
            a.wrapper.hover(function (f) {
                a.wrapperInner.addClass(b.cls + "-hover");
                h(f)
            }, function (f) {
                a.wrapperInner.removeClass(b.cls + "-hover");
                h(f)
            });
            d.addClass("hidden").after(a.wrapper);
            var c = !1;
            d.attr("id") && (c = g("label[for=" + d.attr("id") + "]"), c.length || (c = !1));
            c || (c = d.closest ? d.closest("label") : d.parents("label:eq(0)"), c.length || (c = !1));
            c && (c.hover(function (b) {
                a.wrapper.trigger("mouseover", [b])
            }, function (b) {
                a.wrapper.trigger("mouseout", [b])
            }), c.click(function (a) {
                d.trigger("click", [a]);
                h(a);
                return !1
            }), c.mousedown(function () {
                a.wrapperInner.addClass(b.cls + "-clicked")
            }).mouseup(function () {
                a.wrapperInner.removeClass(b.cls + "-clicked")
            }));
            a.wrapper.click(function (a) {
                d.trigger("click", [a]);
                h(a);
                return !1
            });
            d.click(function (a) {
                h(a)
            });
            d.bind("disable", function () {
                a.wrapperInner.addClass(b.cls + "-disabled")
            }).bind("enable", function () {
                a.wrapperInner.removeClass(b.cls + "-disabled")
            });
            d.bind("check", function () {
                a.wrapper.addClass(b.cls + "-checked")
            }).bind("uncheck", function () {
                a.wrapper.removeClass(b.cls + "-checked")
            });
            g("img", a.wrapper).bind("dragstart", function () {
                return !1
            });
            a.wrapper.mousedown(function () {
                a.wrapperInner.addClass(b.cls + "-clicked")
            }).mouseup(function () {
                a.wrapperInner.removeClass(b.cls + "-clicked")
            });
            window.getSelection && a.wrapper.css("MozUserSelect", "none");
            a.checked && a.wrapper.addClass(b.cls + "-checked");
            a.disabled && a.wrapperInner.addClass(b.cls + "-disabled")
        })
    }
})(jQuery);
(function () {
    var b;
    b = function () {
        function b() {
            this.options_index = 0;
            this.parsed = []
        }
        b.prototype.add_node = function (e) {
            return e.nodeName === "OPTGROUP" ? this.add_group(e) : this.add_option(e)
        };
        b.prototype.add_group = function (e) {
            var b, d, j, f, c, a;
            b = this.parsed.length;
            this.parsed.push({
                array_index: b,
                group: !0,
                label: e.label,
                children: 0,
                disabled: e.disabled
            });
            c = e.childNodes;
            a = [];
            for (j = 0, f = c.length; j < f; j++) d = c[j], a.push(this.add_option(d, b, e.disabled));
            return a
        };
        b.prototype.add_option = function (b, d, g) {
            if (b.nodeName === "OPTION") return b.text !== "" ? (d != null && (this.parsed[d].children += 1), this.parsed.push({
                array_index: this.parsed.length,
                options_index: this.options_index,
                value: b.value,
                text: b.text,
                html: b.innerHTML,
                selected: b.selected,
                disabled: g === !0 ? g : b.disabled,
                group_array_index: d,
                classes: b.className,
                style: b.style.cssText
            })) : this.parsed.push({
                array_index: this.parsed.length,
                options_index: this.options_index,
                empty: !0
            }), this.options_index += 1
        };
        return b
    }();
    b.select_to_array = function (d) {
        var e, h, g, j;
        e = new b;
        j = d.childNodes;
        for (h = 0, g = j.length; h < g; h++) d = j[h], e.add_node(d);
        return e.parsed
    };
    this.SelectParser = b
}).call(this);
(function () {
    var b = function (b, e) {
            return function () {
                return b.apply(e, arguments)
            }
        };
    this.AbstractChosen = function () {
        function d(b, d) {
            this.form_field = b;
            this.options = d != null ? d : {};
            this.set_default_values();
            this.default_text_default = (this.is_multiple = this.form_field.multiple) ? "Select Some Options" : "Select an Option";
            this.setup();
            this.set_up_html();
            this.register_observers();
            this.finish_setup()
        }
        d.prototype.set_default_values = function () {
            this.click_test_action = b(function (b) {
                return this.test_active_click(b)
            }, this);
            this.activate_action = b(function (b) {
                return this.activate_field(b)
            }, this);
            this.results_showing = this.mouse_on_container = this.active_field = !1;
            this.result_single_selected = this.result_highlighted = null;
            this.allow_single_deselect = this.options.allow_single_deselect != null && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : !1;
            this.disable_search_threshold = this.options.disable_search_threshold || 0;
            this.choices = 0;
            return this.results_none_found = this.options.no_results_text || "No results match"
        };
        d.prototype.mouse_enter = function () {
            return this.mouse_on_container = !0
        };
        d.prototype.mouse_leave = function () {
            return this.mouse_on_container = !1
        };
        d.prototype.input_focus = function () {
            if (!this.active_field) return setTimeout(b(function () {
                return this.container_mousedown()
            }, this), 50)
        };
        d.prototype.input_blur = function () {
            if (!this.mouse_on_container) return this.active_field = !1, setTimeout(b(function () {
                return this.blur_test()
            }, this), 100)
        };
        d.prototype.result_add_option = function (b) {
            var d, g;
            return b.disabled ? "" : (b.dom_id = this.container_id + "_o_" + b.array_index, d = b.selected && this.is_multiple ? [] : ["active-result"], b.selected && d.push("result-selected"), b.group_array_index != null && d.push("group-option"), b.classes !== "" && d.push(b.classes), g = b.style.cssText !== "" ? ' style="' + b.style + '"' : "", '<li id="' + b.dom_id + '" class="' + d.join(" ") + '"' + g + ">" + b.html + "</li>")
        };
        d.prototype.results_update_field = function () {
            this.result_clear_highlight();
            this.result_single_selected = null;
            return this.results_build()
        };
        d.prototype.results_toggle = function () {
            return this.results_showing ? this.results_hide() : this.results_show()
        };
        d.prototype.results_search = function () {
            return this.results_showing ? this.winnow_results() : this.results_show()
        };
        d.prototype.keyup_checker = function (b) {
            var d, g;
            d = (g = b.which) != null ? g : b.keyCode;
            this.search_field_scale();
            switch (d) {
            case 8:
                if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) return this.keydown_backstroke();
                else if (!this.pending_backstroke) return this.result_clear_highlight(), this.results_search();
                break;
            case 13:
                b.preventDefault();
                if (this.results_showing) return this.result_select(b);
                break;
            case 27:
                if (this.results_showing) return this.results_hide();
                break;
            case 9:
            case 38:
            case 40:
            case 16:
            case 91:
            case 17:
                break;
            default:
                return this.results_search()
            }
        };
        d.prototype.generate_field_id = function () {
            var b;
            b = this.generate_random_id();
            return this.form_field.id = b
        };
        d.prototype.generate_random_char = function () {
            var b;
            b = Math.floor(Math.random() * 36);
            return "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ".substring(b, b + 1)
        };
        return d
    }()
}).call(this);
(function () {
    var b, d, e, h, g = Object.prototype.hasOwnProperty,
        j = function (b, a) {
            function i() {
                this.constructor = b
            }
            for (var m in a) g.call(a, m) && (b[m] = a[m]);
            i.prototype = a.prototype;
            b.prototype = new i;
            b.__super__ = a.prototype;
            return b
        },
        f = function (b, a) {
            return function () {
                return b.apply(a, arguments)
            }
        };
    h = this;
    b = jQuery;
    b.fn.extend({
        chosen: function (c) {
            return b.browser.msie && (b.browser.version === "6.0" || b.browser.version === "7.0") ? this : b(this).each(function () {
                if (!b(this).hasClass("chzn-done")) return new d(this, c)
            })
        }
    });
    d = function () {
        function c() {
            c.__super__.constructor.apply(this, arguments)
        }
        j(c, AbstractChosen);
        c.prototype.setup = function () {
            this.form_field_jq = b(this.form_field);
            return this.is_rtl = this.form_field_jq.hasClass("chzn-rtl")
        };
        c.prototype.finish_setup = function () {
            return this.form_field_jq.addClass("chzn-done")
        };
        c.prototype.set_up_html = function () {
            var a, i;
            this.container_id = this.form_field.id.length ? this.form_field.id.replace(/(:|\.)/g, "_") : this.generate_field_id();
            this.container_id += "_chzn";
            this.f_width = this.form_field_jq.outerWidth();
            this.default_text = this.form_field_jq.data("placeholder") ? this.form_field_jq.data("placeholder") : this.default_text_default;
            a = b("<div />", {
                id: this.container_id,
                "class": "chzn-container" + (this.is_rtl ? " chzn-rtl" : ""),
                style: "width: " + this.f_width + "px;"
            });
            this.is_multiple ? a.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop" style="left:-9000px;"><ul class="chzn-results"></ul></div>') : a.html('<a href="javascript:void(0)" class="chzn-single"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>');
            this.form_field_jq.hide().after(a);
            this.container = b("#" + this.container_id);
            this.container.addClass("chzn-container-" + (this.is_multiple ? "multi" : "single"));
            !this.is_multiple && this.form_field.options.length <= this.disable_search_threshold && this.container.addClass("chzn-container-single-nosearch");
            this.dropdown = this.container.find("div.chzn-drop").first();
            a = this.container.height();
            i = this.f_width - e(this.dropdown);
            this.dropdown.css({
                width: i + "px",
                top: a + "px"
            });
            this.search_field = this.container.find("input").first();
            this.search_results = this.container.find("ul.chzn-results").first();
            this.search_field_scale();
            this.search_no_results = this.container.find("li.no-results").first();
            this.is_multiple ? (this.search_choices = this.container.find("ul.chzn-choices").first(), this.search_container = this.container.find("li.search-field").first()) : (this.search_container = this.container.find("div.chzn-search").first(), this.selected_item = this.container.find(".chzn-single").first(), a = i - e(this.search_container) - e(this.search_field), this.search_field.css({
                width: a + "px"
            }));
            this.results_build();
            return this.set_tab_index()
        };
        c.prototype.register_observers = function () {
            this.container.mousedown(f(function (a) {
                return this.container_mousedown(a)
            }, this));
            this.container.mouseup(f(function (a) {
                return this.container_mouseup(a)
            }, this));
            this.container.mouseenter(f(function (a) {
                return this.mouse_enter(a)
            }, this));
            this.container.mouseleave(f(function (a) {
                return this.mouse_leave(a)
            }, this));
            this.search_results.mouseup(f(function (a) {
                return this.search_results_mouseup(a)
            }, this));
            this.search_results.mouseover(f(function (a) {
                return this.search_results_mouseover(a)
            }, this));
            this.search_results.mouseout(f(function (a) {
                return this.search_results_mouseout(a)
            }, this));
            this.form_field_jq.bind("liszt:updated", f(function (a) {
                return this.results_update_field(a)
            }, this));
            this.search_field.blur(f(function (a) {
                return this.input_blur(a)
            }, this));
            this.search_field.keyup(f(function (a) {
                return this.keyup_checker(a)
            }, this));
            this.search_field.keydown(f(function (a) {
                return this.keydown_checker(a)
            }, this));
            if (this.is_multiple) return this.search_choices.click(f(function (a) {
                return this.choices_click(a)
            }, this)), this.search_field.focus(f(function (a) {
                return this.input_focus(a)
            }, this))
        };
        c.prototype.search_field_disabled = function () {
            if (this.is_disabled = this.form_field_jq.attr("disabled")) return this.container.addClass("chzn-disabled"), this.search_field.attr("disabled", !0), this.is_multiple || this.selected_item.unbind("focus", this.activate_action), this.close_field();
            else if (this.container.removeClass("chzn-disabled"), this.search_field.attr("disabled", !1), !this.is_multiple) return this.selected_item.bind("focus", this.activate_action)
        };
        c.prototype.container_mousedown = function (a) {
            var i;
            if (!this.is_disabled) if (i = a != null ? b(a.target).hasClass("search-choice-close") : !1, a && a.type === "mousedown" && a.stopPropagation(), !this.pending_destroy_click && !i) {
                if (this.active_field) {
                    if (!this.is_multiple && a && (b(a.target) === this.selected_item || b(a.target).parents("a.chzn-single").length)) a.preventDefault(), this.results_toggle()
                } else this.is_multiple && this.search_field.val(""), b(document).click(this.click_test_action), this.results_show();
                return this.activate_field()
            } else return this.pending_destroy_click = !1
        };
        c.prototype.container_mouseup = function (a) {
            if (a.target.nodeName === "ABBR") return this.results_reset(a)
        };
        c.prototype.blur_test = function () {
            if (!this.active_field && this.container.hasClass("chzn-container-active")) return this.close_field()
        };
        c.prototype.close_field = function () {
            b(document).unbind("click", this.click_test_action);
            this.is_multiple || (this.selected_item.attr("tabindex", this.search_field.attr("tabindex")), this.search_field.attr("tabindex", -1));
            this.active_field = !1;
            this.results_hide();
            this.container.removeClass("chzn-container-active");
            this.winnow_results_clear();
            this.clear_backstroke();
            this.show_search_field_default();
            return this.search_field_scale()
        };
        c.prototype.activate_field = function () {
            !this.is_multiple && !this.active_field && (this.search_field.attr("tabindex", this.selected_item.attr("tabindex")), this.selected_item.attr("tabindex", -1));
            this.container.addClass("chzn-container-active");
            this.active_field = !0;
            this.search_field.val(this.search_field.val());
            return this.search_field.focus()
        };
        c.prototype.test_active_click = function (a) {
            return b(a.target).parents("#" + this.container_id).length ? this.active_field = !0 : this.close_field()
        };
        c.prototype.results_build = function () {
            var a, b, c, d, e;
            this.parsing = !0;
            this.results_data = h.SelectParser.select_to_array(this.form_field);
            this.is_multiple && this.choices > 0 ? (this.search_choices.find("li.search-choice").remove(), this.choices = 0) : this.is_multiple || this.selected_item.find("span").text(this.default_text);
            a = "";
            e = this.results_data;
            for (c = 0, d = e.length; c < d; c++) b = e[c], b.group ? a += this.result_add_group(b) : b.empty || (a += this.result_add_option(b), b.selected && this.is_multiple ? this.choice_build(b) : b.selected && !this.is_multiple && (this.selected_item.find("span").text(b.text), this.allow_single_deselect && this.single_deselect_control_build()));
            this.search_field_disabled();
            this.show_search_field_default();
            this.search_field_scale();
            this.search_results.html(a);
            return this.parsing = !1
        };
        c.prototype.result_add_group = function (a) {
            return a.disabled ? "" : (a.dom_id = this.container_id + "_g_" + a.array_index, '<li id="' + a.dom_id + '" class="group-result">' + b("<div />").text(a.label).html() + "</li>")
        };
        c.prototype.result_do_highlight = function (a) {
            var b, c, d, e;
            if (a.length) if (this.result_clear_highlight(), this.result_highlight = a, this.result_highlight.addClass("highlighted"), c = parseInt(this.search_results.css("maxHeight"), 10), e = this.search_results.scrollTop(), d = c + e, b = this.result_highlight.position().top + this.search_results.scrollTop(), a = b + this.result_highlight.outerHeight(), a >= d) return this.search_results.scrollTop(a - c > 0 ? a - c : 0);
            else if (b < e) return this.search_results.scrollTop(b)
        };
        c.prototype.result_clear_highlight = function () {
            this.result_highlight && this.result_highlight.removeClass("highlighted");
            return this.result_highlight = null
        };
        c.prototype.results_show = function () {
            this.is_multiple || (this.selected_item.addClass("chzn-single-with-drop"), this.result_single_selected && this.result_do_highlight(this.result_single_selected));
            this.dropdown.css({
                top: (this.is_multiple ? this.container.height() : this.container.height() - 1) + "px",
                left: 0
            });
            this.results_showing = !0;
            this.search_field.focus();
            this.search_field.val(this.search_field.val());
            return this.winnow_results()
        };
        c.prototype.results_hide = function () {
            this.is_multiple || this.selected_item.removeClass("chzn-single-with-drop");
            this.result_clear_highlight();
            this.dropdown.css({
                left: "-9000px"
            });
            return this.results_showing = !1
        };
        c.prototype.set_tab_index = function () {
            var a;
            if (this.form_field_jq.attr("tabindex")) return a = this.form_field_jq.attr("tabindex"), this.form_field_jq.attr("tabindex", -1), this.is_multiple ? this.search_field.attr("tabindex", a) : (this.selected_item.attr("tabindex", a), this.search_field.attr("tabindex", -1))
        };
        c.prototype.show_search_field_default = function () {
            return this.is_multiple && this.choices < 1 && !this.active_field ? (this.search_field.val(this.default_text), this.search_field.addClass("default")) : (this.search_field.val(""), this.search_field.removeClass("default"))
        };
        c.prototype.search_results_mouseup = function (a) {
            var i;
            i = b(a.target).hasClass("active-result") ? b(a.target) : b(a.target).parents(".active-result").first();
            if (i.length) return this.result_highlight = i, this.result_select(a)
        };
        c.prototype.search_results_mouseover = function (a) {
            if (a = b(a.target).hasClass("active-result") ? b(a.target) : b(a.target).parents(".active-result").first()) return this.result_do_highlight(a)
        };
        c.prototype.search_results_mouseout = function (a) {
            if (b(a.target).hasClass("active-result")) return this.result_clear_highlight()
        };
        c.prototype.choices_click = function (a) {
            a.preventDefault();
            if (this.active_field && !b(a.target).hasClass("search-choice") && !this.results_showing) return this.results_show()
        };
        c.prototype.choice_build = function (a) {
            var i;
            i = this.container_id + "_c_" + a.array_index;
            this.choices += 1;
            this.search_container.before('<li class="search-choice" id="' + i + '"><span>' + a.html + '</span><a href="javascript:void(0)" class="search-choice-close" rel="' + a.array_index + '"></a></li>');
            return b("#" + i).find("a").first().click(f(function (a) {
                return this.choice_destroy_link_click(a)
            }, this))
        };
        c.prototype.choice_destroy_link_click = function (a) {
            a.preventDefault();
            return this.is_disabled ? a.stopPropagation : (this.pending_destroy_click = !0, this.choice_destroy(b(a.target)))
        };
        c.prototype.choice_destroy = function (a) {
            this.choices -= 1;
            this.show_search_field_default();
            this.is_multiple && this.choices > 0 && this.search_field.val().length < 1 && this.results_hide();
            this.result_deselect(a.attr("rel"));
            return a.parents("li").first().remove()
        };
        c.prototype.results_reset = function (a) {
            this.form_field.options[0].selected = !0;
            this.selected_item.find("span").text(this.default_text);
            this.show_search_field_default();
            b(a.target).remove();
            this.form_field_jq.trigger("change");
            if (this.active_field) return this.results_hide()
        };
        c.prototype.result_select = function (a) {
            var b, c;
            if (this.result_highlight) return b = this.result_highlight, c = b.attr("id"), this.result_clear_highlight(), this.is_multiple ? this.result_deactivate(b) : (this.search_results.find(".result-selected").removeClass("result-selected"), this.result_single_selected = b), b.addClass("result-selected"), b = c.substr(c.lastIndexOf("_") + 1), b = this.results_data[b], b.selected = !0, this.form_field.options[b.options_index].selected = !0, this.is_multiple ? this.choice_build(b) : (this.selected_item.find("span").first().text(b.text), this.allow_single_deselect && this.single_deselect_control_build()), (!a.metaKey || !this.is_multiple) && this.results_hide(), this.search_field.val(""), this.form_field_jq.trigger("change"), this.search_field_scale()
        };
        c.prototype.result_activate = function (a) {
            return a.addClass("active-result")
        };
        c.prototype.result_deactivate = function (a) {
            return a.removeClass("active-result")
        };
        c.prototype.result_deselect = function (a) {
            var c;
            c = this.results_data[a];
            c.selected = !1;
            this.form_field.options[c.options_index].selected = !1;
            b("#" + this.container_id + "_o_" + a).removeClass("result-selected").addClass("active-result").show();
            this.result_clear_highlight();
            this.winnow_results();
            this.form_field_jq.trigger("change");
            return this.search_field_scale()
        };
        c.prototype.single_deselect_control_build = function () {
            if (this.allow_single_deselect && this.selected_item.find("abbr").length < 1) return this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>')
        };
        c.prototype.winnow_results = function () {
            var a, c, d, e, f, g, j, h, o, k, l, p, q, n;
            this.no_results_clear();
            j = 0;
            h = this.search_field.val() === this.default_text ? "" : b("<div/>").text(b.trim(this.search_field.val())).html();
            f = RegExp("^" + h.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), "i");
            o = RegExp(h.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), "i");
            n = this.results_data;
            for (k = 0, p = n.length; k < p; k++) if (c = n[k], !c.disabled && !c.empty) if (c.group) b("#" + c.dom_id).hide();
            else if (!this.is_multiple || !c.selected) {
                a = !1;
                g = c.dom_id;
                if (f.test(c.html)) a = !0, j += 1;
                else if (c.html.indexOf(" ") >= 0 || c.html.indexOf("[") === 0) if (e = c.html.replace(/\[|\]/g, "").split(" "), e.length) for (l = 0, q = e.length; l < q; l++) d = e[l], f.test(d) && (a = !0, j += 1);
                a ? (h.length ? (a = c.html.search(o), d = c.html.substr(0, a + h.length) + "</em>" + c.html.substr(a + h.length), d = d.substr(0, a) + "<em>" + d.substr(a)) : d = c.html, b("#" + g).html !== d && b("#" + g).html(d), this.result_activate(b("#" + g)), c.group_array_index != null && b("#" + this.results_data[c.group_array_index].dom_id).show()) : (this.result_highlight && g === this.result_highlight.attr("id") && this.result_clear_highlight(), this.result_deactivate(b("#" + g)))
            }
            return j < 1 && h.length ? this.no_results(h) : this.winnow_results_set_highlight()
        };
        c.prototype.winnow_results_clear = function () {
            var a, c, d, e, f;
            this.search_field.val("");
            c = this.search_results.find("li");
            f = [];
            for (d = 0, e = c.length; d < e; d++) a = c[d], a = b(a), f.push(a.hasClass("group-result") ? a.show() : !this.is_multiple || !a.hasClass("result-selected") ? this.result_activate(a) : void 0);
            return f
        };
        c.prototype.winnow_results_set_highlight = function () {
            var a;
            if (!this.result_highlight && (a = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [], a = a.length ? a.first() : this.search_results.find(".active-result").first(), a != null)) return this.result_do_highlight(a)
        };
        c.prototype.no_results = function (a) {
            var c;
            c = b('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
            c.find("span").first().html(a);
            return this.search_results.append(c)
        };
        c.prototype.no_results_clear = function () {
            return this.search_results.find(".no-results").remove()
        };
        c.prototype.keydown_arrow = function () {
            var a;
            this.result_highlight ? this.results_showing && (a = this.result_highlight.nextAll("li.active-result").first()) && this.result_do_highlight(a) : (a = this.search_results.find("li.active-result").first()) && this.result_do_highlight(b(a));
            if (!this.results_showing) return this.results_show()
        };
        c.prototype.keyup_arrow = function () {
            var a;
            if (!this.results_showing && !this.is_multiple) return this.results_show();
            else if (this.result_highlight) return a = this.result_highlight.prevAll("li.active-result"), a.length ? this.result_do_highlight(a.first()) : (this.choices > 0 && this.results_hide(), this.result_clear_highlight())
        };
        c.prototype.keydown_backstroke = function () {
            return this.pending_backstroke ? (this.choice_destroy(this.pending_backstroke.find("a").first()), this.clear_backstroke()) : (this.pending_backstroke = this.search_container.siblings("li.search-choice").last(), this.pending_backstroke.addClass("search-choice-focus"))
        };
        c.prototype.clear_backstroke = function () {
            this.pending_backstroke && this.pending_backstroke.removeClass("search-choice-focus");
            return this.pending_backstroke = null
        };
        c.prototype.keydown_checker = function (a) {
            var b, c;
            b = (c = a.which) != null ? c : a.keyCode;
            this.search_field_scale();
            b !== 8 && this.pending_backstroke && this.clear_backstroke();
            switch (b) {
            case 8:
                this.backstroke_length = this.search_field.val().length;
                break;
            case 9:
                this.mouse_on_container = !1;
                break;
            case 13:
                a.preventDefault();
                break;
            case 38:
                a.preventDefault();
                this.keyup_arrow();
                break;
            case 40:
                this.keydown_arrow()
            }
        };
        c.prototype.search_field_scale = function () {
            var a, c, d, e, f;
            if (this.is_multiple) {
                c = "position:absolute; left: -1000px; top: -1000px; display:none;";
                d = "font-size,font-style,font-weight,font-family,line-height,text-transform,letter-spacing".split(",");
                for (e = 0, f = d.length; e < f; e++) a = d[e], c += a + ":" + this.search_field.css(a) + ";";
                a = b("<div />", {
                    style: c
                });
                a.text(this.search_field.val());
                b("body").append(a);
                c = a.width() + 25;
                a.remove();
                c > this.f_width - 10 && (c = this.f_width - 10);
                this.search_field.css({
                    width: c + "px"
                });
                a = this.container.height();
                return this.dropdown.css({
                    top: a + "px"
                })
            }
        };
        c.prototype.generate_random_id = function () {
            var a;
            for (a = "sel" + this.generate_random_char() + this.generate_random_char() + this.generate_random_char(); b("#" + a).length > 0;) a += this.generate_random_char();
            return a
        };
        return c
    }();
    e = function (b) {
        return b.outerWidth() - b.width()
    };
    h.get_side_border_padding = e
}).call(this);
(function (g, pa, l) {
    g.fn.dataTableSettings = [];
    var q = g.fn.dataTableSettings;
    g.fn.dataTableExt = {};
    var i = g.fn.dataTableExt;
    i.sVersion = "1.8.2";
    i.sErrMode = "alert";
    i.iApiIndex = 0;
    i.oApi = {};
    i.afnFiltering = [];
    i.aoFeatures = [];
    i.ofnSearch = {};
    i.afnSortData = [];
    i.oStdClasses = {
        sPagePrevEnabled: "paginate_enabled_previous",
        sPagePrevDisabled: "paginate_disabled_previous",
        sPageNextEnabled: "paginate_enabled_next",
        sPageNextDisabled: "paginate_disabled_next",
        sPageJUINext: "",
        sPageJUIPrev: "",
        sPageButton: "paginate_button",
        sPageButtonActive: "paginate_active",
        sPageButtonStaticDisabled: "paginate_button paginate_button_disabled",
        sPageFirst: "first",
        sPagePrevious: "previous",
        sPageNext: "next",
        sPageLast: "last",
        sStripeOdd: "odd",
        sStripeEven: "even",
        sRowEmpty: "dataTables_empty",
        sWrapper: "dataTables_wrapper",
        sFilter: "dataTables_filter",
        sInfo: "dataTables_info",
        sPaging: "dataTables_paginate paging_",
        sLength: "dataTables_length",
        sProcessing: "dataTables_processing",
        sSortAsc: "sorting_asc",
        sSortDesc: "sorting_desc",
        sSortable: "sorting",
        sSortableAsc: "sorting_asc_disabled",
        sSortableDesc: "sorting_desc_disabled",
        sSortableNone: "sorting_disabled",
        sSortColumn: "sorting_",
        sSortJUIAsc: "",
        sSortJUIDesc: "",
        sSortJUI: "",
        sSortJUIAscAllowed: "",
        sSortJUIDescAllowed: "",
        sSortJUIWrapper: "",
        sSortIcon: "",
        sScrollWrapper: "dataTables_scroll",
        sScrollHead: "dataTables_scrollHead",
        sScrollHeadInner: "dataTables_scrollHeadInner",
        sScrollBody: "dataTables_scrollBody",
        sScrollFoot: "dataTables_scrollFoot",
        sScrollFootInner: "dataTables_scrollFootInner",
        sFooterTH: ""
    };
    i.oJUIClasses = {
        sPagePrevEnabled: "fg-button ui-button ui-state-default ui-corner-left",
        sPagePrevDisabled: "fg-button ui-button ui-state-default ui-corner-left ui-state-disabled",
        sPageNextEnabled: "fg-button ui-button ui-state-default ui-corner-right",
        sPageNextDisabled: "fg-button ui-button ui-state-default ui-corner-right ui-state-disabled",
        sPageJUINext: "ui-icon ui-icon-circle-arrow-e",
        sPageJUIPrev: "ui-icon ui-icon-circle-arrow-w",
        sPageButton: "fg-button ui-button ui-state-default",
        sPageButtonActive: "fg-button ui-button ui-state-default ui-state-disabled",
        sPageButtonStaticDisabled: "fg-button ui-button ui-state-default ui-state-disabled",
        sPageFirst: "first ui-corner-tl ui-corner-bl",
        sPagePrevious: "previous",
        sPageNext: "next",
        sPageLast: "last ui-corner-tr ui-corner-br",
        sStripeOdd: "odd",
        sStripeEven: "even",
        sRowEmpty: "dataTables_empty",
        sWrapper: "dataTables_wrapper",
        sFilter: "dataTables_filter",
        sInfo: "dataTables_info",
        sPaging: "dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",
        sLength: "dataTables_length",
        sProcessing: "dataTables_processing",
        sSortAsc: "ui-state-default",
        sSortDesc: "ui-state-default",
        sSortable: "ui-state-default",
        sSortableAsc: "ui-state-default",
        sSortableDesc: "ui-state-default",
        sSortableNone: "ui-state-default",
        sSortColumn: "sorting_",
        sSortJUIAsc: "css_right ui-icon ui-icon-triangle-1-n",
        sSortJUIDesc: "css_right ui-icon ui-icon-triangle-1-s",
        sSortJUI: "css_right ui-icon ui-icon-carat-2-n-s",
        sSortJUIAscAllowed: "css_right ui-icon ui-icon-carat-1-n",
        sSortJUIDescAllowed: "css_right ui-icon ui-icon-carat-1-s",
        sSortJUIWrapper: "DataTables_sort_wrapper",
        sSortIcon: "DataTables_sort_icon",
        sScrollWrapper: "dataTables_scroll",
        sScrollHead: "dataTables_scrollHead ui-state-default",
        sScrollHeadInner: "dataTables_scrollHeadInner",
        sScrollBody: "dataTables_scrollBody",
        sScrollFoot: "dataTables_scrollFoot ui-state-default",
        sScrollFootInner: "dataTables_scrollFootInner",
        sFooterTH: "ui-state-default"
    };
    i.oPagination = {
        two_button: {
            fnInit: function (e, i, t) {
                var k, m, x;
                e.bJUI ? (k = l.createElement("a"), m = l.createElement("a"), x = l.createElement("span"), x.className = e.oClasses.sPageJUINext, m.appendChild(x), x = l.createElement("span"), x.className = e.oClasses.sPageJUIPrev, k.appendChild(x)) : (k = l.createElement("div"), m = l.createElement("div"));
                k.className = e.oClasses.sPagePrevDisabled;
                m.className = e.oClasses.sPageNextDisabled;
                k.title = e.oLanguage.oPaginate.sPrevious;
                m.title = e.oLanguage.oPaginate.sNext;
                i.appendChild(k);
                i.appendChild(m);
                g(k).bind("click.DT", function () {
                    e.oApi._fnPageChange(e, "previous") && t(e)
                });
                g(m).bind("click.DT", function () {
                    e.oApi._fnPageChange(e, "next") && t(e)
                });
                g(k).bind("selectstart.DT", function () {
                    return !1
                });
                g(m).bind("selectstart.DT", function () {
                    return !1
                });
                e.sTableId !== "" && typeof e.aanFeatures.p == "undefined" && (i.setAttribute("id", e.sTableId + "_paginate"), k.setAttribute("id", e.sTableId + "_previous"), m.setAttribute("id", e.sTableId + "_next"))
            },
            fnUpdate: function (e) {
                if (e.aanFeatures.p) for (var g = e.aanFeatures.p, i = 0, k = g.length; i < k; i++) if (g[i].childNodes.length !== 0) g[i].childNodes[0].className = e._iDisplayStart === 0 ? e.oClasses.sPagePrevDisabled : e.oClasses.sPagePrevEnabled, g[i].childNodes[1].className = e.fnDisplayEnd() == e.fnRecordsDisplay() ? e.oClasses.sPageNextDisabled : e.oClasses.sPageNextEnabled
            }
        },
        iFullNumbersShowPages: 5,
        full_numbers: {
            fnInit: function (e, i, t) {
                var k = l.createElement("span"),
                    m = l.createElement("span"),
                    x = l.createElement("span"),
                    q = l.createElement("span"),
                    u = l.createElement("span");
                k.innerHTML = e.oLanguage.oPaginate.sFirst;
                m.innerHTML = e.oLanguage.oPaginate.sPrevious;
                q.innerHTML = e.oLanguage.oPaginate.sNext;
                u.innerHTML = e.oLanguage.oPaginate.sLast;
                var p = e.oClasses;
                k.className = p.sPageButton + " " + p.sPageFirst;
                m.className = p.sPageButton + " " + p.sPagePrevious;
                q.className = p.sPageButton + " " + p.sPageNext;
                u.className = p.sPageButton + " " + p.sPageLast;
                i.appendChild(k);
                i.appendChild(m);
                i.appendChild(x);
                i.appendChild(q);
                i.appendChild(u);
                g(k).bind("click.DT", function () {
                    e.oApi._fnPageChange(e, "first") && t(e)
                });
                g(m).bind("click.DT", function () {
                    e.oApi._fnPageChange(e, "previous") && t(e)
                });
                g(q).bind("click.DT", function () {
                    e.oApi._fnPageChange(e, "next") && t(e)
                });
                g(u).bind("click.DT", function () {
                    e.oApi._fnPageChange(e, "last") && t(e)
                });
                g("span", i).bind("mousedown.DT", function () {
                    return !1
                }).bind("selectstart.DT", function () {
                    return !1
                });
                e.sTableId !== "" && typeof e.aanFeatures.p == "undefined" && (i.setAttribute("id", e.sTableId + "_paginate"), k.setAttribute("id", e.sTableId + "_first"), m.setAttribute("id", e.sTableId + "_previous"), q.setAttribute("id", e.sTableId + "_next"), u.setAttribute("id", e.sTableId + "_last"))
            },
            fnUpdate: function (e, l) {
                if (e.aanFeatures.p) {
                    var t = i.oPagination.iFullNumbersShowPages,
                        k = Math.floor(t / 2),
                        m = Math.ceil(e.fnRecordsDisplay() / e._iDisplayLength),
                        x = Math.ceil(e._iDisplayStart / e._iDisplayLength) + 1,
                        q = "",
                        u, p = e.oClasses;
                    m < t ? (k = 1, u = m) : x <= k ? (k = 1, u = t) : x >= m - k ? (k = m - t + 1, u = m) : (k = x - Math.ceil(t / 2) + 1, u = k + t - 1);
                    for (t = k; t <= u; t++) q += x != t ? '<span class="' + p.sPageButton + '">' + t + "</span>" : '<span class="' + p.sPageButtonActive + '">' + t + "</span>";
                    u = e.aanFeatures.p;
                    var s, R = function (g) {
                            e._iDisplayStart = (this.innerHTML * 1 - 1) * e._iDisplayLength;
                            l(e);
                            g.preventDefault()
                        },
                        O = function () {
                            return !1
                        };
                    for (t = 0, k = u.length; t < k; t++) u[t].childNodes.length !== 0 && (s = g("span:eq(2)", u[t]), s.html(q), g("span", s).bind("click.DT", R).bind("mousedown.DT", O).bind("selectstart.DT", O), s = u[t].getElementsByTagName("span"), s = [s[0], s[1], s[s.length - 2], s[s.length - 1]], g(s).removeClass(p.sPageButton + " " + p.sPageButtonActive + " " + p.sPageButtonStaticDisabled), x == 1 ? (s[0].className += " " + p.sPageButtonStaticDisabled, s[1].className += " " + p.sPageButtonStaticDisabled) : (s[0].className += " " + p.sPageButton, s[1].className += " " + p.sPageButton), m === 0 || x == m || e._iDisplayLength == -1 ? (s[2].className += " " + p.sPageButtonStaticDisabled, s[3].className += " " + p.sPageButtonStaticDisabled) : (s[2].className += " " + p.sPageButton, s[3].className += " " + p.sPageButton))
                }
            }
        }
    };
    i.oSort = {
        "string-asc": function (e, g) {
            typeof e != "string" && (e = "");
            typeof g != "string" && (g = "");
            var i = e.toLowerCase(),
                k = g.toLowerCase();
            return i < k ? -1 : i > k ? 1 : 0
        },
        "string-desc": function (e, g) {
            typeof e != "string" && (e = "");
            typeof g != "string" && (g = "");
            var i = e.toLowerCase(),
                k = g.toLowerCase();
            return i < k ? 1 : i > k ? -1 : 0
        },
        "html-asc": function (e, g) {
            var i = e.replace(/<.*?>/g, "").toLowerCase(),
                k = g.replace(/<.*?>/g, "").toLowerCase();
            return i < k ? -1 : i > k ? 1 : 0
        },
        "html-desc": function (e, g) {
            var i = e.replace(/<.*?>/g, "").toLowerCase(),
                k = g.replace(/<.*?>/g, "").toLowerCase();
            return i < k ? 1 : i > k ? -1 : 0
        },
        "date-asc": function (e, g) {
            var i = Date.parse(e),
                k = Date.parse(g);
            if (isNaN(i) || i === "") i = Date.parse("01/01/1970 00:00:00");
            if (isNaN(k) || k === "") k = Date.parse("01/01/1970 00:00:00");
            return i - k
        },
        "date-desc": function (e, g) {
            var i = Date.parse(e),
                k = Date.parse(g);
            if (isNaN(i) || i === "") i = Date.parse("01/01/1970 00:00:00");
            if (isNaN(k) || k === "") k = Date.parse("01/01/1970 00:00:00");
            return k - i
        },
        "numeric-asc": function (e, g) {
            return (e == "-" || e === "" ? 0 : e * 1) - (g == "-" || g === "" ? 0 : g * 1)
        },
        "numeric-desc": function (e, g) {
            return (g == "-" || g === "" ? 0 : g * 1) - (e == "-" || e === "" ? 0 : e * 1)
        }
    };
    i.aTypes = [function (e) {
        if (typeof e == "number") return "numeric";
        else if (typeof e != "string") return null;
        var g, i = !1;
        g = e.charAt(0);
        if ("0123456789-".indexOf(g) == -1) return null;
        for (var k = 1; k < e.length; k++) {
            g = e.charAt(k);
            if ("0123456789.".indexOf(g) == -1) return null;
            if (g == ".") {
                if (i) return null;
                i = !0
            }
        }
        return "numeric"
    }, function (e) {
        var g = Date.parse(e);
        return g !== null && !isNaN(g) || typeof e == "string" && e.length === 0 ? "date" : null
    }, function (e) {
        return typeof e == "string" && e.indexOf("<") != -1 && e.indexOf(">") != -1 ? "html" : null
    }];
    i.fnVersionCheck = function (e) {
        for (var g = function (e, g) {
                for (; e.length < g;) e += "0";
                return e
            }, l = i.sVersion.split("."), e = e.split("."), k = "", m = "", q = 0, M = e.length; q < M; q++) k += g(l[q], 3), m += g(e[q], 3);
        return parseInt(k, 10) >= parseInt(m, 10)
    };
    i._oExternConfig = {
        iNextUnique: 0
    };
    g.fn.dataTable = function (e) {
        function Pa() {
            this.fnRecordsTotal = function () {
                return this.oFeatures.bServerSide ? parseInt(this._iRecordsTotal, 10) : this.aiDisplayMaster.length
            };
            this.fnRecordsDisplay = function () {
                return this.oFeatures.bServerSide ? parseInt(this._iRecordsDisplay, 10) : this.aiDisplay.length
            };
            this.fnDisplayEnd = function () {
                return this.oFeatures.bServerSide ? this.oFeatures.bPaginate === !1 || this._iDisplayLength == -1 ? this._iDisplayStart + this.aiDisplay.length : Math.min(this._iDisplayStart + this._iDisplayLength, this._iRecordsDisplay) : this._iDisplayEnd
            };
            this.sInstance = this.oInstance = null;
            this.oFeatures = {
                bPaginate: !0,
                bLengthChange: !0,
                bFilter: !0,
                bSort: !0,
                bInfo: !0,
                bAutoWidth: !0,
                bProcessing: !1,
                bSortClasses: !0,
                bStateSave: !1,
                bServerSide: !1,
                bDeferRender: !1
            };
            this.oScroll = {
                sX: "",
                sXInner: "",
                sY: "",
                bCollapse: !1,
                bInfinite: !1,
                iLoadGap: 100,
                iBarWidth: 0,
                bAutoCss: !0
            };
            this.aanFeatures = [];
            this.oLanguage = {
                sProcessing: "Processing...",
                sLengthMenu: "Show entries: _MENU_",
                sZeroRecords: "No matching records found",
                sEmptyTable: "No data available in table",
                sLoadingRecords: "Loading...",
                sInfo: "Showing _START_ to _END_ of _TOTAL_ entries",
                sInfoEmpty: "Showing 0 to 0 of 0 entries",
                sInfoFiltered: "(filtered from _MAX_ total entries)",
                sInfoPostFix: "",
                sInfoThousands: ",",
                sSearch: "Search:",
                sUrl: "",
                oPaginate: {
                    sFirst: "First",
                    sPrevious: "Previous",
                    sNext: "Next",
                    sLast: "Last"
                },
                fnInfoCallback: null
            };
            this.aoData = [];
            this.aiDisplay = [];
            this.aiDisplayMaster = [];
            this.aoColumns = [];
            this.aoHeader = [];
            this.aoFooter = [];
            this.iNextId = 0;
            this.asDataSearch = [];
            this.oPreviousSearch = {
                sSearch: "",
                bRegex: !1,
                bSmart: !0
            };
            this.aoPreSearchCols = [];
            this.aaSorting = [
                [0, "asc", 0]
            ];
            this.aaSortingFixed = null;
            this.asStripeClasses = [];
            this.asDestroyStripes = [];
            this.sDestroyWidth = 0;
            this.fnFooterCallback = this.fnHeaderCallback = this.fnRowCallback = null;
            this.aoDrawCallback = [];
            this.fnInitComplete = this.fnPreDrawCallback = null;
            this.sTableId = "";
            this.nTableWrapper = this.nTBody = this.nTFoot = this.nTHead = this.nTable = null;
            this.bInitialised = this.bDeferLoading = !1;
            this.aoOpenRows = [];
            this.sDom = '<"top"lf<"clear">>rt<"actions"<"actions-left"i><"actions-right"p>>';
            this.sPaginationType = "full_numbers";
            this.iCookieDuration = 7200;
            this.sCookiePrefix = "SpryMedia_DataTables_";
            this.fnCookieCallback = null;
            this.aoStateSave = [];
            this.aoStateLoad = [];
            this.sAjaxSource = this.oLoadedState = null;
            this.sAjaxDataProp = "aaData";
            this.bAjaxDataGet = !0;
            this.jqXHR = null;
            this.fnServerData = function (a, b, c, d) {
                d.jqXHR = g.ajax({
                    url: a,
                    data: b,
                    success: function (a) {
                        g(d.oInstance).trigger("xhr", d);
                        c(a)
                    },
                    dataType: "json",
                    cache: !1,
                    error: function (a, b) {
                        b == "parsererror" && alert("DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")
                    }
                })
            };
            this.aoServerParams = [];
            this.fnFormatNumber = function (a) {
                if (a < 1E3) return a;
                else for (var b = a + "", a = b.split(""), c = "", b = b.length, d = 0; d < b; d++) d % 3 === 0 && d !== 0 && (c = this.oLanguage.sInfoThousands + c), c = a[b - d - 1] + c;
                return c
            };
            this.aLengthMenu = [10, 25, 50, 100];
            this.bDrawing = this.iDraw = 0;
            this.iDrawError = -1;
            this._iDisplayLength = 10;
            this._iDisplayStart = 0;
            this._iDisplayEnd = 10;
            this._iRecordsDisplay = this._iRecordsTotal = 0;
            this.bJUI = !1;
            this.oClasses = i.oStdClasses;
            this.bSortCellsTop = this.bSorted = this.bFiltered = !1;
            this.oInit = null;
            this.aoDestroyCallback = []
        }
        function t(a) {
            return function () {
                var b = [w(this[i.iApiIndex])].concat(Array.prototype.slice.call(arguments));
                return i.oApi[a].apply(this, b)
            }
        }
        function k(a) {
            var b, c, d = a.iInitDisplayStart;
            if (a.bInitialised === !1) setTimeout(function () {
                k(a)
            }, 200);
            else {
                qa(a);
                O(a);
                N(a, a.aoHeader);
                a.nTFoot && N(a, a.aoFooter);
                C(a, !0);
                a.oFeatures.bAutoWidth && Y(a);
                for (b = 0, c = a.aoColumns.length; b < c; b++) if (a.aoColumns[b].sWidth !== null) a.aoColumns[b].nTh.style.width = o(a.aoColumns[b].sWidth);
                a.oFeatures.bSort ? I(a) : a.oFeatures.bFilter ? D(a, a.oPreviousSearch) : (a.aiDisplay = a.aiDisplayMaster.slice(), z(a), y(a));
                a.sAjaxSource !== null && !a.oFeatures.bServerSide ? (c = [], Z(a, c), a.fnServerData.call(a.oInstance, a.sAjaxSource, c, function (c) {
                    var f = c;
                    a.sAjaxDataProp !== "" && (f = S(a.sAjaxDataProp)(c));
                    for (b = 0; b < f.length; b++) p(a, f[b]);
                    a.iInitDisplayStart = d;
                    a.oFeatures.bSort ? I(a) : (a.aiDisplay = a.aiDisplayMaster.slice(), z(a), y(a));
                    C(a, !1);
                    m(a, c)
                }, a)) : a.oFeatures.bServerSide || (C(a, !1), m(a))
            }
        }
        function m(a, b) {
            a._bInitComplete = !0;
            typeof a.fnInitComplete == "function" && (typeof b != "undefined" ? a.fnInitComplete.call(a.oInstance, a, b) : a.fnInitComplete.call(a.oInstance, a))
        }
        function x(a, b, c) {
            a.oLanguage = g.extend(!0, a.oLanguage, b);
            typeof b.sEmptyTable == "undefined" && typeof b.sZeroRecords != "undefined" && j(a.oLanguage, b, "sZeroRecords", "sEmptyTable");
            typeof b.sLoadingRecords == "undefined" && typeof b.sZeroRecords != "undefined" && j(a.oLanguage, b, "sZeroRecords", "sLoadingRecords");
            c && k(a)
        }
        function M(a, b) {
            var c = a.aoColumns.length,
                d = {
                    sType: null,
                    _bAutoType: !0,
                    bVisible: !0,
                    bSearchable: !0,
                    bSortable: !0,
                    asSorting: ["asc", "desc"],
                    sSortingClass: a.oClasses.sSortable,
                    sSortingClassJUI: a.oClasses.sSortJUI,
                    sTitle: b ? b.innerHTML : "",
                    sName: "",
                    sWidth: null,
                    sWidthOrig: null,
                    sClass: null,
                    fnRender: null,
                    bUseRendered: !0,
                    iDataSort: c,
                    mDataProp: c,
                    fnGetData: null,
                    fnSetData: null,
                    sSortDataType: "std",
                    sDefaultContent: null,
                    sContentPadding: "",
                    nTh: b ? b : l.createElement("th"),
                    nTf: null
                };
            a.aoColumns.push(d);
            if (typeof a.aoPreSearchCols[c] == "undefined" || a.aoPreSearchCols[c] === null) a.aoPreSearchCols[c] = {
                sSearch: "",
                bRegex: !1,
                bSmart: !0
            };
            else {
                if (typeof a.aoPreSearchCols[c].bRegex == "undefined") a.aoPreSearchCols[c].bRegex = !0;
                if (typeof a.aoPreSearchCols[c].bSmart == "undefined") a.aoPreSearchCols[c].bSmart = !0
            }
            u(a, c, null)
        }
        function u(a, b, c) {
            b = a.aoColumns[b];
            if (typeof c != "undefined" && c !== null) {
                if (typeof c.sType != "undefined") b.sType = c.sType, b._bAutoType = !1;
                j(b, c, "bVisible");
                j(b, c, "bSearchable");
                j(b, c, "bSortable");
                j(b, c, "sTitle");
                j(b, c, "sName");
                j(b, c, "sWidth");
                j(b, c, "sWidth", "sWidthOrig");
                j(b, c, "sClass");
                j(b, c, "fnRender");
                j(b, c, "bUseRendered");
                j(b, c, "iDataSort");
                j(b, c, "mDataProp");
                j(b, c, "asSorting");
                j(b, c, "sSortDataType");
                j(b, c, "sDefaultContent");
                j(b, c, "sContentPadding")
            }
            b.fnGetData = S(b.mDataProp);
            b.fnSetData = ra(b.mDataProp);
            if (!a.oFeatures.bSort) b.bSortable = !1;
            if (!b.bSortable || g.inArray("asc", b.asSorting) == -1 && g.inArray("desc", b.asSorting) == -1) b.sSortingClass = a.oClasses.sSortableNone, b.sSortingClassJUI = "";
            else if (b.bSortable || g.inArray("asc", b.asSorting) == -1 && g.inArray("desc", b.asSorting) == -1) b.sSortingClass = a.oClasses.sSortable, b.sSortingClassJUI = a.oClasses.sSortJUI;
            else if (g.inArray("asc", b.asSorting) != -1 && g.inArray("desc", b.asSorting) == -1) b.sSortingClass = a.oClasses.sSortableAsc, b.sSortingClassJUI = a.oClasses.sSortJUIAscAllowed;
            else if (g.inArray("asc", b.asSorting) == -1 && g.inArray("desc", b.asSorting) != -1) b.sSortingClass = a.oClasses.sSortableDesc, b.sSortingClassJUI = a.oClasses.sSortJUIDescAllowed
        }
        function p(a, b) {
            var c;
            c = g.isArray(b) ? b.slice() : g.extend(!0, {}, b);
            var d = a.aoData.length,
                h = {
                    nTr: null,
                    _iId: a.iNextId++,
                    _aData: c,
                    _anHidden: [],
                    _sRowStripe: ""
                };
            a.aoData.push(h);
            for (var f, e = 0, v = a.aoColumns.length; e < v; e++) if (c = a.aoColumns[e], typeof c.fnRender == "function" && c.bUseRendered && c.mDataProp !== null && F(a, d, e, c.fnRender({
                iDataRow: d,
                iDataColumn: e,
                aData: h._aData,
                oSettings: a
            })), c._bAutoType && c.sType != "string" && (f = A(a, d, e, "type"), f !== null && f !== "")) if (f = $(f), c.sType === null) c.sType = f;
            else if (c.sType != f && c.sType != "html") c.sType = "string";
            a.aiDisplayMaster.push(d);
            a.oFeatures.bDeferRender || s(a, d);
            return d
        }
        function s(a, b) {
            var c = a.aoData[b],
                d;
            if (c.nTr === null) {
                c.nTr = l.createElement("tr");
                typeof c._aData.DT_RowId != "undefined" && c.nTr.setAttribute("id", c._aData.DT_RowId);
                typeof c._aData.DT_RowClass != "undefined" && g(c.nTr).addClass(c._aData.DT_RowClass);
                for (var h = 0, f = a.aoColumns.length; h < f; h++) {
                    var e = a.aoColumns[h];
                    d = l.createElement("td");
                    d.innerHTML = typeof e.fnRender == "function" && (!e.bUseRendered || e.mDataProp === null) ? e.fnRender({
                        iDataRow: b,
                        iDataColumn: h,
                        aData: c._aData,
                        oSettings: a
                    }) : A(a, b, h, "display");
                    if (e.sClass !== null) d.className = e.sClass;
                    e.bVisible ? (c.nTr.appendChild(d), c._anHidden[h] = null) : c._anHidden[h] = d
                }
            }
        }
        function R(a) {
            var b, c, d, h, f, e, v, i, n;
            if (a.bDeferLoading || a.sAjaxSource === null) {
                v = a.nTBody.childNodes;
                for (b = 0, c = v.length; b < c; b++) if (v[b].nodeName.toUpperCase() == "TR") {
                    i = a.aoData.length;
                    a.aoData.push({
                        nTr: v[b],
                        _iId: a.iNextId++,
                        _aData: [],
                        _anHidden: [],
                        _sRowStripe: ""
                    });
                    a.aiDisplayMaster.push(i);
                    e = v[b].childNodes;
                    f = 0;
                    for (d = 0, h = e.length; d < h; d++) if (n = e[d].nodeName.toUpperCase(), n == "TD" || n == "TH") F(a, i, f, g.trim(e[d].innerHTML)), f++
                }
            }
            v = T(a);
            e = [];
            for (b = 0, c = v.length; b < c; b++) for (d = 0, h = v[b].childNodes.length; d < h; d++) f = v[b].childNodes[d], n = f.nodeName.toUpperCase(), (n == "TD" || n == "TH") && e.push(f);
            e.length != v.length * a.aoColumns.length && B(a, 1, "Unexpected number of TD elements. Expected " + v.length * a.aoColumns.length + " and got " + e.length + ". DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination.");
            for (d = 0, h = a.aoColumns.length; d < h; d++) {
                if (a.aoColumns[d].sTitle === null) a.aoColumns[d].sTitle = a.aoColumns[d].nTh.innerHTML;
                v = a.aoColumns[d]._bAutoType;
                n = typeof a.aoColumns[d].fnRender == "function";
                f = a.aoColumns[d].sClass !== null;
                i = a.aoColumns[d].bVisible;
                var k, j;
                if (v || n || f || !i) for (b = 0, c = a.aoData.length; b < c; b++) {
                    k = e[b * h + d];
                    if (v && a.aoColumns[d].sType != "string" && (j = A(a, b, d, "type"), j !== "")) if (j = $(j), a.aoColumns[d].sType === null) a.aoColumns[d].sType = j;
                    else if (a.aoColumns[d].sType != j && a.aoColumns[d].sType != "html") a.aoColumns[d].sType = "string";
                    if (n) j = a.aoColumns[d].fnRender({
                        iDataRow: b,
                        iDataColumn: d,
                        aData: a.aoData[b]._aData,
                        oSettings: a
                    }), k.innerHTML = j, a.aoColumns[d].bUseRendered && F(a, b, d, j);
                    f && (k.className += " " + a.aoColumns[d].sClass);
                    i ? a.aoData[b]._anHidden[d] = null : (a.aoData[b]._anHidden[d] = k, k.parentNode.removeChild(k))
                }
            }
        }
        function O(a) {
            var b, c, d;
            a.nTHead.getElementsByTagName("tr");
            if (a.nTHead.getElementsByTagName("th").length !== 0) for (b = 0, d = a.aoColumns.length; b < d; b++) {
                if (c = a.aoColumns[b].nTh, a.aoColumns[b].sClass !== null && g(c).addClass(a.aoColumns[b].sClass), a.aoColumns[b].sTitle != c.innerHTML) c.innerHTML = a.aoColumns[b].sTitle
            } else {
                var h = l.createElement("tr");
                for (b = 0, d = a.aoColumns.length; b < d; b++) c = a.aoColumns[b].nTh, c.innerHTML = a.aoColumns[b].sTitle, a.aoColumns[b].sClass !== null && g(c).addClass(a.aoColumns[b].sClass), h.appendChild(c);
                g(a.nTHead).html("")[0].appendChild(h);
                P(a.aoHeader, a.nTHead)
            }
            if (a.bJUI) for (b = 0, d = a.aoColumns.length; b < d; b++) {
                c = a.aoColumns[b].nTh;
                h = l.createElement("div");
                h.className = a.oClasses.sSortJUIWrapper;
                g(c).contents().appendTo(h);
                var f = l.createElement("span");
                f.className = a.oClasses.sSortIcon;
                h.appendChild(f);
                c.appendChild(h)
            }
            d = function () {
                this.onselectstart = function () {
                    return !1
                };
                return !1
            };
            if (a.oFeatures.bSort) for (b = 0; b < a.aoColumns.length; b++) a.aoColumns[b].bSortable !== !1 ? (aa(a, a.aoColumns[b].nTh, b), g(a.aoColumns[b].nTh).bind("mousedown.DT", d)) : g(a.aoColumns[b].nTh).addClass(a.oClasses.sSortableNone);
            a.oClasses.sFooterTH !== "" && g(a.nTFoot).children("tr").children("th").addClass(a.oClasses.sFooterTH);
            if (a.nTFoot !== null) {
                c = J(a, null, a.aoFooter);
                for (b = 0, d = a.aoColumns.length; b < d; b++) if (typeof c[b] != "undefined") a.aoColumns[b].nTf = c[b]
            }
        }
        function N(a, b, c) {
            var d, h, f, e = [],
                g = [],
                i = a.aoColumns.length;
            typeof c == "undefined" && (c = !1);
            for (d = 0, h = b.length; d < h; d++) {
                e[d] = b[d].slice();
                e[d].nTr = b[d].nTr;
                for (f = i - 1; f >= 0; f--)!a.aoColumns[f].bVisible && !c && e[d].splice(f, 1);
                g.push([])
            }
            for (d = 0, h = e.length; d < h; d++) {
                if (e[d].nTr) for (a = 0, f = e[d].nTr.childNodes.length; a < f; a++) e[d].nTr.removeChild(e[d].nTr.childNodes[0]);
                for (f = 0, b = e[d].length; f < b; f++) if (i = c = 1, typeof g[d][f] == "undefined") {
                    e[d].nTr.appendChild(e[d][f].cell);
                    for (g[d][f] = 1; typeof e[d + c] != "undefined" && e[d][f].cell == e[d + c][f].cell;) g[d + c][f] = 1, c++;
                    for (; typeof e[d][f + i] != "undefined" && e[d][f].cell == e[d][f + i].cell;) {
                        for (a = 0; a < c; a++) g[d + a][f + i] = 1;
                        i++
                    }
                    e[d][f].cell.rowSpan = c;
                    e[d][f].cell.colSpan = i
                }
            }
        }
        function y(a) {
            var b, c, d = [],
                h = 0,
                f = !1;
            b = a.asStripeClasses.length;
            c = a.aoOpenRows.length;
            if (!(a.fnPreDrawCallback !== null && a.fnPreDrawCallback.call(a.oInstance, a) === !1)) {
                a.bDrawing = !0;
                if (typeof a.iInitDisplayStart != "undefined" && a.iInitDisplayStart != -1) a._iDisplayStart = a.oFeatures.bServerSide ? a.iInitDisplayStart : a.iInitDisplayStart >= a.fnRecordsDisplay() ? 0 : a.iInitDisplayStart, a.iInitDisplayStart = -1, z(a);
                if (a.bDeferLoading) a.bDeferLoading = !1, a.iDraw++;
                else if (a.oFeatures.bServerSide) {
                    if (!a.bDestroying && !sa(a)) return
                } else a.iDraw++;
                if (a.aiDisplay.length !== 0) {
                    var e = a._iDisplayStart,
                        i = a._iDisplayEnd;
                    if (a.oFeatures.bServerSide) e = 0, i = a.aoData.length;
                    for (; e < i; e++) {
                        var r = a.aoData[a.aiDisplay[e]];
                        r.nTr === null && s(a, a.aiDisplay[e]);
                        var n = r.nTr;
                        if (b !== 0) {
                            var j = a.asStripeClasses[h % b];
                            if (r._sRowStripe != j) g(n).removeClass(r._sRowStripe).addClass(j), r._sRowStripe = j
                        }
                        typeof a.fnRowCallback == "function" && (n = a.fnRowCallback.call(a.oInstance, n, a.aoData[a.aiDisplay[e]]._aData, h, e), !n && !f && (B(a, 0, "A node was not returned by fnRowCallback"), f = !0));
                        d.push(n);
                        h++;
                        if (c !== 0) for (r = 0; r < c; r++) n == a.aoOpenRows[r].nParent && d.push(a.aoOpenRows[r].nTr)
                    }
                } else {
                    d[0] = l.createElement("tr");
                    if (typeof a.asStripeClasses[0] != "undefined") d[0].className = a.asStripeClasses[0];
                    f = a.oLanguage.sZeroRecords.replace("_MAX_", a.fnFormatNumber(a.fnRecordsTotal()));
                    if (a.iDraw == 1 && a.sAjaxSource !== null && !a.oFeatures.bServerSide) f = a.oLanguage.sLoadingRecords;
                    else if (typeof a.oLanguage.sEmptyTable != "undefined" && a.fnRecordsTotal() === 0) f = a.oLanguage.sEmptyTable;
                    b = l.createElement("td");
                    b.setAttribute("valign", "top");
                    b.colSpan = Q(a);
                    b.className = a.oClasses.sRowEmpty;
                    b.innerHTML = f;
                    d[h].appendChild(b)
                }
                typeof a.fnHeaderCallback == "function" && a.fnHeaderCallback.call(a.oInstance, g(a.nTHead).children("tr")[0], U(a), a._iDisplayStart, a.fnDisplayEnd(), a.aiDisplay);
                typeof a.fnFooterCallback == "function" && a.fnFooterCallback.call(a.oInstance, g(a.nTFoot).children("tr")[0], U(a), a._iDisplayStart, a.fnDisplayEnd(), a.aiDisplay);
                h = l.createDocumentFragment();
                b = l.createDocumentFragment();
                if (a.nTBody) {
                    f = a.nTBody.parentNode;
                    b.appendChild(a.nTBody);
                    if (!a.oScroll.bInfinite || !a._bInitComplete || a.bSorted || a.bFiltered) {
                        c = a.nTBody.childNodes;
                        for (b = c.length - 1; b >= 0; b--) c[b].parentNode.removeChild(c[b])
                    }
                    for (b = 0, c = d.length; b < c; b++) h.appendChild(d[b]);
                    a.nTBody.appendChild(h);
                    f !== null && f.appendChild(a.nTBody)
                }
                for (b = a.aoDrawCallback.length - 1; b >= 0; b--) a.aoDrawCallback[b].fn.call(a.oInstance, a);
                g(a.oInstance).trigger("draw", a);
                a.bSorted = !1;
                a.bFiltered = !1;
                a.bDrawing = !1;
                a.oFeatures.bServerSide && (C(a, !1), typeof a._bInitComplete == "undefined" && m(a))
            }
        }
        function V(a) {
            a.oFeatures.bSort ? I(a, a.oPreviousSearch) : a.oFeatures.bFilter ? D(a, a.oPreviousSearch) : (z(a), y(a))
        }
        function sa(a) {
            if (a.bAjaxDataGet) {
                a.iDraw++;
                C(a, !0);
                var b = ta(a);
                Z(a, b);
                a.fnServerData.call(a.oInstance, a.sAjaxSource, b, function (b) {
                    ua(a, b)
                }, a);
                return !1
            } else return !0
        }
        function ta(a) {
            var b = a.aoColumns.length,
                c = [],
                d, h;
            c.push({
                name: "sEcho",
                value: a.iDraw
            });
            c.push({
                name: "iColumns",
                value: b
            });
            c.push({
                name: "sColumns",
                value: ba(a)
            });
            c.push({
                name: "iDisplayStart",
                value: a._iDisplayStart
            });
            c.push({
                name: "iDisplayLength",
                value: a.oFeatures.bPaginate !== !1 ? a._iDisplayLength : -1
            });
            for (h = 0; h < b; h++) d = a.aoColumns[h].mDataProp, c.push({
                name: "mDataProp_" + h,
                value: typeof d == "function" ? "function" : d
            });
            if (a.oFeatures.bFilter !== !1) {
                c.push({
                    name: "sSearch",
                    value: a.oPreviousSearch.sSearch
                });
                c.push({
                    name: "bRegex",
                    value: a.oPreviousSearch.bRegex
                });
                for (h = 0; h < b; h++) c.push({
                    name: "sSearch_" + h,
                    value: a.aoPreSearchCols[h].sSearch
                }), c.push({
                    name: "bRegex_" + h,
                    value: a.aoPreSearchCols[h].bRegex
                }), c.push({
                    name: "bSearchable_" + h,
                    value: a.aoColumns[h].bSearchable
                })
            }
            if (a.oFeatures.bSort !== !1) {
                d = a.aaSortingFixed !== null ? a.aaSortingFixed.length : 0;
                var f = a.aaSorting.length;
                c.push({
                    name: "iSortingCols",
                    value: d + f
                });
                for (h = 0; h < d; h++) c.push({
                    name: "iSortCol_" + h,
                    value: a.aaSortingFixed[h][0]
                }), c.push({
                    name: "sSortDir_" + h,
                    value: a.aaSortingFixed[h][1]
                });
                for (h = 0; h < f; h++) c.push({
                    name: "iSortCol_" + (h + d),
                    value: a.aaSorting[h][0]
                }), c.push({
                    name: "sSortDir_" + (h + d),
                    value: a.aaSorting[h][1]
                });
                for (h = 0; h < b; h++) c.push({
                    name: "bSortable_" + h,
                    value: a.aoColumns[h].bSortable
                })
            }
            return c
        }
        function Z(a, b) {
            for (var c = 0, d = a.aoServerParams.length; c < d; c++) a.aoServerParams[c].fn.call(a.oInstance, b)
        }
        function ua(a, b) {
            if (typeof b.sEcho != "undefined") if (b.sEcho * 1 < a.iDraw) return;
            else a.iDraw = b.sEcho * 1;
            (!a.oScroll.bInfinite || a.oScroll.bInfinite && (a.bSorted || a.bFiltered)) && ca(a);
            a._iRecordsTotal = b.iTotalRecords;
            a._iRecordsDisplay = b.iTotalDisplayRecords;
            var c = ba(a);
            if (c = typeof b.sColumns != "undefined" && c !== "" && b.sColumns != c) var d = va(a, b.sColumns);
            for (var h = S(a.sAjaxDataProp)(b), f = 0, e = h.length; f < e; f++) if (c) {
                for (var g = [], i = 0, n = a.aoColumns.length; i < n; i++) g.push(h[f][d[i]]);
                p(a, g)
            } else p(a, h[f]);
            a.aiDisplay = a.aiDisplayMaster.slice();
            a.bAjaxDataGet = !1;
            y(a);
            a.bAjaxDataGet = !0;
            C(a, !1)
        }
        function qa(a) {
            var b = l.createElement("div");
            a.nTable.parentNode.insertBefore(b, a.nTable);
            a.nTableWrapper = l.createElement("div");
            a.nTableWrapper.className = a.oClasses.sWrapper;
            a.sTableId !== "" && a.nTableWrapper.setAttribute("id", a.sTableId + "_wrapper");
            a.nTableReinsertBefore = a.nTable.nextSibling;
            for (var c = a.nTableWrapper, d = a.sDom.split(""), h, f, e, g, r, n, j, k = 0; k < d.length; k++) {
                f = 0;
                e = d[k];
                if (e == "<") {
                    g = l.createElement("div");
                    r = d[k + 1];
                    if (r == "'" || r == '"') {
                        n = "";
                        for (j = 2; d[k + j] != r;) n += d[k + j], j++;
                        n == "H" ? n = "fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix" : n == "F" && (n = "fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix");
                        n.indexOf(".") != -1 ? (r = n.split("."), g.setAttribute("id", r[0].substr(1, r[0].length - 1)), g.className = r[1]) : n.charAt(0) == "#" ? g.setAttribute("id", n.substr(1, n.length - 1)) : g.className = n;
                        k += j
                    }
                    c.appendChild(g);
                    c = g
                } else if (e == ">") c = c.parentNode;
                else if (e == "l" && a.oFeatures.bPaginate && a.oFeatures.bLengthChange) h = wa(a), f = 1;
                else if (e == "f" && a.oFeatures.bFilter) h = xa(a), f = 1;
                else if (e == "r" && a.oFeatures.bProcessing) h = ya(a), f = 1;
                else if (e == "t") h = za(a), f = 1;
                else if (e == "i" && a.oFeatures.bInfo) h = Aa(a), f = 1;
                else if (e == "p" && a.oFeatures.bPaginate) h = Ba(a), f = 1;
                else if (i.aoFeatures.length !== 0) {
                    g = i.aoFeatures;
                    j = 0;
                    for (r = g.length; j < r; j++) if (e == g[j].cFeature) {
                        (h = g[j].fnInit(a)) && (f = 1);
                        break
                    }
                }
                f == 1 && h !== null && (typeof a.aanFeatures[e] != "object" && (a.aanFeatures[e] = []), a.aanFeatures[e].push(h), c.appendChild(h))
            }
            b.parentNode.replaceChild(a.nTableWrapper, b)
        }
        function za(a) {
            if (a.oScroll.sX === "" && a.oScroll.sY === "") return a.nTable;
            var b = l.createElement("div"),
                c = l.createElement("div"),
                d = l.createElement("div"),
                h = l.createElement("div"),
                f = l.createElement("div"),
                E = l.createElement("div"),
                v = a.nTable.cloneNode(!1),
                j = a.nTable.cloneNode(!1),
                n = a.nTable.getElementsByTagName("thead")[0],
                k = a.nTable.getElementsByTagName("tfoot").length === 0 ? null : a.nTable.getElementsByTagName("tfoot")[0],
                m = typeof e.bJQueryUI != "undefined" && e.bJQueryUI ? i.oJUIClasses : i.oStdClasses;
            c.appendChild(d);
            f.appendChild(E);
            h.appendChild(a.nTable);
            b.appendChild(c);
            b.appendChild(h);
            d.appendChild(v);
            v.appendChild(n);
            k !== null && (b.appendChild(f), E.appendChild(j), j.appendChild(k));
            b.className = m.sScrollWrapper;
            c.className = m.sScrollHead;
            d.className = m.sScrollHeadInner;
            h.className = m.sScrollBody;
            f.className = m.sScrollFoot;
            E.className = m.sScrollFootInner;
            if (a.oScroll.bAutoCss) c.style.overflow = "hidden", c.style.position = "relative", f.style.overflow = "hidden", h.style.overflow = "auto";
            c.style.border = "0";
            c.style.width = "100%";
            f.style.border = "0";
            d.style.width = "150%";
            v.removeAttribute("id");
            v.style.marginLeft = "0";
            a.nTable.style.marginLeft = "0";
            if (k !== null) j.removeAttribute("id"), j.style.marginLeft = "0";
            d = g(a.nTable).children("caption");
            E = 0;
            for (j = d.length; E < j; E++) v.appendChild(d[E]);
            if (a.oScroll.sX !== "") {
                c.style.width = o(a.oScroll.sX);
                h.style.width = o(a.oScroll.sX);
                if (k !== null) f.style.width = o(a.oScroll.sX);
                g(h).scroll(function () {
                    c.scrollLeft = this.scrollLeft;
                    if (k !== null) f.scrollLeft = this.scrollLeft
                })
            }
            if (a.oScroll.sY !== "") h.style.height = o(a.oScroll.sY);
            a.aoDrawCallback.push({
                fn: Ca,
                sName: "scrolling"
            });
            a.oScroll.bInfinite && g(h).scroll(function () {
                !a.bDrawing && g(this).scrollTop() + g(this).height() > g(a.nTable).height() - a.oScroll.iLoadGap && a.fnDisplayEnd() < a.fnRecordsDisplay() && (da(a, "next"), z(a), y(a))
            });
            a.nScrollHead = c;
            a.nScrollFoot = f;
            return b
        }
        function Ca(a) {
            var b = a.nScrollHead.getElementsByTagName("div")[0],
                c = b.getElementsByTagName("table")[0],
                d = a.nTable.parentNode,
                h, f, e, i, j, k, l, m, p = [],
                q = a.nTFoot !== null ? a.nScrollFoot.getElementsByTagName("div")[0] : null,
                t = a.nTFoot !== null ? q.getElementsByTagName("table")[0] : null,
                s = g.browser.msie && g.browser.version <= 7;
            e = a.nTable.getElementsByTagName("thead");
            e.length > 0 && a.nTable.removeChild(e[0]);
            a.nTFoot !== null && (j = a.nTable.getElementsByTagName("tfoot"), j.length > 0 && a.nTable.removeChild(j[0]));
            e = a.nTHead.cloneNode(!0);
            a.nTable.insertBefore(e, a.nTable.childNodes[0]);
            a.nTFoot !== null && (j = a.nTFoot.cloneNode(!0), a.nTable.insertBefore(j, a.nTable.childNodes[1]));
            if (a.oScroll.sX === "") d.style.width = "100%", b.parentNode.style.width = "100%";
            var u = J(a, e);
            for (h = 0, f = u.length; h < f; h++) l = Da(a, h), u[h].style.width = a.aoColumns[l].sWidth;
            a.nTFoot !== null && G(function (a) {
                a.style.width = ""
            }, j.getElementsByTagName("tr"));
            h = g(a.nTable).outerWidth();
            if (a.oScroll.sX === "") {
                if (a.nTable.style.width = "100%", s && (d.scrollHeight > d.offsetHeight || g(d).css("overflow-y") == "scroll")) a.nTable.style.width = o(g(a.nTable).outerWidth() - a.oScroll.iBarWidth)
            } else if (a.oScroll.sXInner !== "") a.nTable.style.width = o(a.oScroll.sXInner);
            else if (h == g(d).width() && g(d).height() < g(a.nTable).height()) {
                if (a.nTable.style.width = o(h - a.oScroll.iBarWidth), g(a.nTable).outerWidth() > h - a.oScroll.iBarWidth) a.nTable.style.width = o(h)
            } else a.nTable.style.width = o(h);
            h = g(a.nTable).outerWidth();
            f = a.nTHead.getElementsByTagName("tr");
            e = e.getElementsByTagName("tr");
            G(function (a, b) {
                k = a.style;
                k.paddingTop = "0";
                k.paddingBottom = "0";
                k.borderTopWidth = "0";
                k.borderBottomWidth = "0";
                k.height = 0;
                m = g(a).width();
                b.style.width = o(m);
                p.push(m)
            }, e, f);
            g(e).height(0);
            a.nTFoot !== null && (i = j.getElementsByTagName("tr"), j = a.nTFoot.getElementsByTagName("tr"), G(function (a, b) {
                k = a.style;
                k.paddingTop = "0";
                k.paddingBottom = "0";
                k.borderTopWidth = "0";
                k.borderBottomWidth = "0";
                k.height = 0;
                m = g(a).width();
                b.style.width = o(m);
                p.push(m)
            }, i, j), g(i).height(0));
            G(function (a) {
                a.innerHTML = "";
                a.style.width = o(p.shift())
            }, e);
            a.nTFoot !== null && G(function (a) {
                a.innerHTML = "";
                a.style.width = o(p.shift())
            }, i);
            if (g(a.nTable).outerWidth() < h) {
                i = d.scrollHeight > d.offsetHeight || g(d).css("overflow-y") == "scroll" ? h + a.oScroll.iBarWidth : h;
                if (s && (d.scrollHeight > d.offsetHeight || g(d).css("overflow-y") == "scroll")) a.nTable.style.width = o(i - a.oScroll.iBarWidth);
                d.style.width = o(i);
                b.parentNode.style.width = o(i);
                if (a.nTFoot !== null) q.parentNode.style.width = o(i);
                a.oScroll.sX === "" ? B(a, 1, "The table cannot fit into the current element which will cause column misalignment. The table has been drawn at its minimum possible width.") : a.oScroll.sXInner !== "" && B(a, 1, "The table cannot fit into the current element which will cause column misalignment. Increase the sScrollXInner value or remove it to allow automatic calculation")
            } else if (d.style.width = o("100%"), b.parentNode.style.width = o("100%"), a.nTFoot !== null) q.parentNode.style.width = o("100%");
            if (a.oScroll.sY === "" && s) d.style.height = o(a.nTable.offsetHeight + a.oScroll.iBarWidth);
            if (a.oScroll.sY !== "" && a.oScroll.bCollapse && (d.style.height = o(a.oScroll.sY), s = a.oScroll.sX !== "" && a.nTable.offsetWidth > d.offsetWidth ? a.oScroll.iBarWidth : 0, a.nTable.offsetHeight < d.offsetHeight)) d.style.height = o(g(a.nTable).height() + s);
            s = g(a.nTable).outerWidth();
            c.style.width = o(s);
            b.style.width = o(s + a.oScroll.iBarWidth);
            if (a.nTFoot !== null) q.style.width = o(a.nTable.offsetWidth + a.oScroll.iBarWidth), t.style.width = o(a.nTable.offsetWidth);
            if (a.bSorted || a.bFiltered) d.scrollTop = 0
        }
        function W(a) {
            if (a.oFeatures.bAutoWidth === !1) return !1;
            Y(a);
            for (var b = 0, c = a.aoColumns.length; b < c; b++) a.aoColumns[b].nTh.style.width = a.aoColumns[b].sWidth
        }
        function xa(a) {
            var b = a.oLanguage.sSearch,
                b = b.indexOf("_INPUT_") !== -1 ? b.replace("_INPUT_", '<input type="text" />') : b === "" ? '<input type="text" />' : b + ' <input type="text" />',
                c = l.createElement("div");
            c.className = a.oClasses.sFilter;
            c.innerHTML = "<label>" + b + "</label>";
            a.sTableId !== "" && typeof a.aanFeatures.f == "undefined" && c.setAttribute("id", a.sTableId + "_filter");
            b = g("input", c);
            b.val(a.oPreviousSearch.sSearch.replace('"', "&quot;"));
            b.bind("keyup.DT", function () {
                for (var b = a.aanFeatures.f, c = 0, f = b.length; c < f; c++) b[c] != g(this).parents("div.dataTables_filter")[0] && g("input", b[c]).val(this.value);
                this.value != a.oPreviousSearch.sSearch && D(a, {
                    sSearch: this.value,
                    bRegex: a.oPreviousSearch.bRegex,
                    bSmart: a.oPreviousSearch.bSmart
                })
            });
            b.bind("keypress.DT", function (a) {
                if (a.keyCode == 13) return !1
            });
            return c
        }
        function D(a, b, c) {
            Ea(a, b.sSearch, c, b.bRegex, b.bSmart);
            for (b = 0; b < a.aoPreSearchCols.length; b++) Fa(a, a.aoPreSearchCols[b].sSearch, b, a.aoPreSearchCols[b].bRegex, a.aoPreSearchCols[b].bSmart);
            i.afnFiltering.length !== 0 && Ga(a);
            a.bFiltered = !0;
            g(a.oInstance).trigger("filter", a);
            a._iDisplayStart = 0;
            z(a);
            y(a);
            ea(a, 0)
        }
        function Ga(a) {
            for (var b = i.afnFiltering, c = 0, d = b.length; c < d; c++) for (var h = 0, f = 0, e = a.aiDisplay.length; f < e; f++) {
                var g = a.aiDisplay[f - h];
                b[c](a, X(a, g, "filter"), g) || (a.aiDisplay.splice(f - h, 1), h++)
            }
        }
        function Fa(a, b, c, d, h) {
            if (b !== "") for (var f = 0, b = fa(b, d, h), d = a.aiDisplay.length - 1; d >= 0; d--) h = ga(A(a, a.aiDisplay[d], c, "filter"), a.aoColumns[c].sType), b.test(h) || (a.aiDisplay.splice(d, 1), f++)
        }
        function Ea(a, b, c, d, h) {
            var f = fa(b, d, h);
            if (typeof c == "undefined" || c === null) c = 0;
            i.afnFiltering.length !== 0 && (c = 1);
            if (b.length <= 0) a.aiDisplay.splice(0, a.aiDisplay.length), a.aiDisplay = a.aiDisplayMaster.slice();
            else if (a.aiDisplay.length == a.aiDisplayMaster.length || a.oPreviousSearch.sSearch.length > b.length || c == 1 || b.indexOf(a.oPreviousSearch.sSearch) !== 0) {
                a.aiDisplay.splice(0, a.aiDisplay.length);
                ea(a, 1);
                for (c = 0; c < a.aiDisplayMaster.length; c++) f.test(a.asDataSearch[c]) && a.aiDisplay.push(a.aiDisplayMaster[c])
            } else for (var e = 0, c = 0; c < a.asDataSearch.length; c++) f.test(a.asDataSearch[c]) || (a.aiDisplay.splice(c - e, 1), e++);
            a.oPreviousSearch.sSearch = b;
            a.oPreviousSearch.bRegex = d;
            a.oPreviousSearch.bSmart = h
        }
        function ea(a, b) {
            if (!a.oFeatures.bServerSide) {
                a.asDataSearch.splice(0, a.asDataSearch.length);
                for (var c = typeof b != "undefined" && b == 1 ? a.aiDisplayMaster : a.aiDisplay, d = 0, h = c.length; d < h; d++) a.asDataSearch[d] = ha(a, X(a, c[d], "filter"))
            }
        }
        function ha(a, b) {
            var c = "";
            if (typeof a.__nTmpFilter == "undefined") a.__nTmpFilter = l.createElement("div");
            for (var d = a.__nTmpFilter, h = 0, f = a.aoColumns.length; h < f; h++) a.aoColumns[h].bSearchable && (c += ga(b[h], a.aoColumns[h].sType) + "  ");
            if (c.indexOf("&") !== -1) d.innerHTML = c, c = d.textContent ? d.textContent : d.innerText, c = c.replace(/\n/g, " ").replace(/\r/g, "");
            return c
        }
        function fa(a, b, c) {
            c ? (a = b ? a.split(" ") : ia(a).split(" "), a = "^(?=.*?" + a.join(")(?=.*?") + ").*$") : a = b ? a : ia(a);
            return RegExp(a, "i")
        }
        function ga(a, b) {
            if (typeof i.ofnSearch[b] == "function") return i.ofnSearch[b](a);
            else if (b == "html") return a.replace(/\n/g, " ").replace(/<.*?>/g, "");
            else if (typeof a == "string") return a.replace(/\n/g, " ");
            else if (a === null) return "";
            return a
        }
        function I(a, b) {
            var c, d, h, f, e = [],
                j = [],
                k = i.oSort;
            d = a.aoData;
            var n = a.aoColumns;
            if (!a.oFeatures.bServerSide && (a.aaSorting.length !== 0 || a.aaSortingFixed !== null)) {
                e = a.aaSortingFixed !== null ? a.aaSortingFixed.concat(a.aaSorting) : a.aaSorting.slice();
                for (c = 0; c < e.length; c++) {
                    var l = e[c][0];
                    h = ja(a, l);
                    f = a.aoColumns[l].sSortDataType;
                    if (typeof i.afnSortData[f] != "undefined") {
                        var m = i.afnSortData[f](a, l, h);
                        for (h = 0, f = d.length; h < f; h++) F(a, h, l, m[h])
                    }
                }
                for (c = 0, d = a.aiDisplayMaster.length; c < d; c++) j[a.aiDisplayMaster[c]] = c;
                var o = e.length;
                a.aiDisplayMaster.sort(function (b, d) {
                    var f, h;
                    for (c = 0; c < o; c++) if (f = n[e[c][0]].iDataSort, h = n[f].sType, f = k[(h ? h : "string") + "-" + e[c][1]](A(a, b, f, "sort"), A(a, d, f, "sort")), f !== 0) return f;
                    return k["numeric-asc"](j[b], j[d])
                })
            }(typeof b == "undefined" || b) && !a.oFeatures.bDeferRender && K(a);
            a.bSorted = !0;
            g(a.oInstance).trigger("sort", a);
            a.oFeatures.bFilter ? D(a, a.oPreviousSearch, 1) : (a.aiDisplay = a.aiDisplayMaster.slice(), a._iDisplayStart = 0, z(a), y(a))
        }
        function aa(a, b, c, d) {
            g(b).bind("click.DT", function (b) {
                if (a.aoColumns[c].bSortable !== !1) {
                    var f = function () {
                            var d, f;
                            if (b.shiftKey) {
                                for (var e = !1, g = 0; g < a.aaSorting.length; g++) if (a.aaSorting[g][0] == c) {
                                    e = !0;
                                    d = a.aaSorting[g][0];
                                    f = a.aaSorting[g][2] + 1;
                                    typeof a.aoColumns[d].asSorting[f] == "undefined" ? a.aaSorting.splice(g, 1) : (a.aaSorting[g][1] = a.aoColumns[d].asSorting[f], a.aaSorting[g][2] = f);
                                    break
                                }
                                e === !1 && a.aaSorting.push([c, a.aoColumns[c].asSorting[0], 0])
                            } else a.aaSorting.length == 1 && a.aaSorting[0][0] == c ? (d = a.aaSorting[0][0], f = a.aaSorting[0][2] + 1, typeof a.aoColumns[d].asSorting[f] == "undefined" && (f = 0), a.aaSorting[0][1] = a.aoColumns[d].asSorting[f], a.aaSorting[0][2] = f) : (a.aaSorting.splice(0, a.aaSorting.length), a.aaSorting.push([c, a.aoColumns[c].asSorting[0], 0]));
                            I(a)
                        };
                    a.oFeatures.bProcessing ? (C(a, !0), setTimeout(function () {
                        f();
                        a.oFeatures.bServerSide || C(a, !1)
                    }, 0)) : f();
                    typeof d == "function" && d(a)
                }
            })
        }
        function K(a) {
            var b, c, d, h, f, e = a.aoColumns.length,
                i = a.oClasses;
            for (b = 0; b < e; b++) a.aoColumns[b].bSortable && g(a.aoColumns[b].nTh).removeClass(i.sSortAsc + " " + i.sSortDesc + " " + a.aoColumns[b].sSortingClass);
            h = a.aaSortingFixed !== null ? a.aaSortingFixed.concat(a.aaSorting) : a.aaSorting.slice();
            for (b = 0; b < a.aoColumns.length; b++) if (a.aoColumns[b].bSortable) {
                f = a.aoColumns[b].sSortingClass;
                d = -1;
                for (c = 0; c < h.length; c++) if (h[c][0] == b) {
                    f = h[c][1] == "asc" ? i.sSortAsc : i.sSortDesc;
                    d = c;
                    break
                }
                g(a.aoColumns[b].nTh).addClass(f);
                a.bJUI && (c = g("span", a.aoColumns[b].nTh), c.removeClass(i.sSortJUIAsc + " " + i.sSortJUIDesc + " " + i.sSortJUI + " " + i.sSortJUIAscAllowed + " " + i.sSortJUIDescAllowed), c.addClass(d == -1 ? a.aoColumns[b].sSortingClassJUI : h[d][1] == "asc" ? i.sSortJUIAsc : i.sSortJUIDesc))
            } else g(a.aoColumns[b].nTh).addClass(a.aoColumns[b].sSortingClass);
            f = i.sSortColumn;
            if (a.oFeatures.bSort && a.oFeatures.bSortClasses) {
                d = H(a);
                if (a.oFeatures.bDeferRender) g(d).removeClass(f + "1 " + f + "2 " + f + "3");
                else if (d.length >= e) for (b = 0; b < e; b++) if (d[b].className.indexOf(f + "1") != -1) for (c = 0, a = d.length / e; c < a; c++) d[e * c + b].className = g.trim(d[e * c + b].className.replace(f + "1", ""));
                else if (d[b].className.indexOf(f + "2") != -1) for (c = 0, a = d.length / e; c < a; c++) d[e * c + b].className = g.trim(d[e * c + b].className.replace(f + "2", ""));
                else if (d[b].className.indexOf(f + "3") != -1) for (c = 0, a = d.length / e; c < a; c++) d[e * c + b].className = g.trim(d[e * c + b].className.replace(" " + f + "3", ""));
                var i = 1,
                    j;
                for (b = 0; b < h.length; b++) {
                    j = parseInt(h[b][0], 10);
                    for (c = 0, a = d.length / e; c < a; c++) d[e * c + j].className += " " + f + i;
                    i < 3 && i++
                }
            }
        }

        function Ba(a) {
            if (a.oScroll.bInfinite) return null;
            var b = l.createElement("div");
            b.className = a.oClasses.sPaging + a.sPaginationType;
            i.oPagination[a.sPaginationType].fnInit(a, b, function (a) {
                z(a);
                y(a)
            });
            typeof a.aanFeatures.p == "undefined" && a.aoDrawCallback.push({
                fn: function (a) {
                    i.oPagination[a.sPaginationType].fnUpdate(a, function (a) {
                        z(a);
                        y(a)
                    })
                },
                sName: "pagination"
            });
            return b
        }
        function da(a, b) {
            var c = a._iDisplayStart;
            if (b == "first") a._iDisplayStart = 0;
            else if (b == "previous") {
                if (a._iDisplayStart = a._iDisplayLength >= 0 ? a._iDisplayStart - a._iDisplayLength : 0, a._iDisplayStart < 0) a._iDisplayStart = 0
            } else if (b == "next") a._iDisplayLength >= 0 ? a._iDisplayStart + a._iDisplayLength < a.fnRecordsDisplay() && (a._iDisplayStart += a._iDisplayLength) : a._iDisplayStart = 0;
            else if (b == "last") if (a._iDisplayLength >= 0) {
                var d = parseInt((a.fnRecordsDisplay() - 1) / a._iDisplayLength, 10) + 1;
                a._iDisplayStart = (d - 1) * a._iDisplayLength
            } else a._iDisplayStart = 0;
            else B(a, 0, "Unknown paging action: " + b);
            g(a.oInstance).trigger("page", a);
            return c != a._iDisplayStart
        }

        function Aa(a) {
            var b = l.createElement("div");
            b.className = a.oClasses.sInfo;
            typeof a.aanFeatures.i == "undefined" && (a.aoDrawCallback.push({
                fn: Ha,
                sName: "information"
            }), a.sTableId !== "" && b.setAttribute("id", a.sTableId + "_info"));
            return b
        }
        function Ha(a) {
            if (a.oFeatures.bInfo && a.aanFeatures.i.length !== 0) {
                var b = a._iDisplayStart + 1,
                    c = a.fnDisplayEnd(),
                    d = a.fnRecordsTotal(),
                    h = a.fnRecordsDisplay(),
                    f = a.fnFormatNumber(b),
                    e = a.fnFormatNumber(c),
                    i = a.fnFormatNumber(d),
                    j = a.fnFormatNumber(h);
                a.oScroll.bInfinite && (f = a.fnFormatNumber(1));
                f = a.fnRecordsDisplay() === 0 && a.fnRecordsDisplay() == a.fnRecordsTotal() ? a.oLanguage.sInfoEmpty + a.oLanguage.sInfoPostFix : a.fnRecordsDisplay() === 0 ? a.oLanguage.sInfoEmpty + " " + a.oLanguage.sInfoFiltered.replace("_MAX_", i) + a.oLanguage.sInfoPostFix : a.fnRecordsDisplay() == a.fnRecordsTotal() ? a.oLanguage.sInfo.replace("_START_", f).replace("_END_", e).replace("_TOTAL_", j) + a.oLanguage.sInfoPostFix : a.oLanguage.sInfo.replace("_START_", f).replace("_END_", e).replace("_TOTAL_", j) + " " + a.oLanguage.sInfoFiltered.replace("_MAX_", a.fnFormatNumber(a.fnRecordsTotal())) + a.oLanguage.sInfoPostFix;
                a.oLanguage.fnInfoCallback !== null && (f = a.oLanguage.fnInfoCallback(a, b, c, d, h, f));
                a = a.aanFeatures.i;
                b = 0;
                for (c = a.length; b < c; b++) g(a[b]).html(f)
            }
        }
        function wa(a) {
            if (a.oScroll.bInfinite) return null;
            var b = '<select size="1" ' + (a.sTableId === "" ? "" : 'name="' + a.sTableId + '_length"') + ">",
                c, d;
            if (a.aLengthMenu.length == 2 && typeof a.aLengthMenu[0] == "object" && typeof a.aLengthMenu[1] == "object") for (c = 0, d = a.aLengthMenu[0].length; c < d; c++) b += '<option value="' + a.aLengthMenu[0][c] + '">' + a.aLengthMenu[1][c] + "</option>";
            else for (c = 0, d = a.aLengthMenu.length; c < d; c++) b += '<option value="' + a.aLengthMenu[c] + '">' + a.aLengthMenu[c] + "</option>";
            b += "</select>";
            var h = l.createElement("div");
            a.sTableId !== "" && typeof a.aanFeatures.l == "undefined" && h.setAttribute("id", a.sTableId + "_length");
            h.className = a.oClasses.sLength;
            h.innerHTML = "<label>" + a.oLanguage.sLengthMenu.replace("_MENU_", b) + "</label>";
            g('select option[value="' + a._iDisplayLength + '"]', h).attr("selected", !0);
            g("select", h).bind("change.DT", function () {
                var b = g(this).val(),
                    h = a.aanFeatures.l;
                for (c = 0, d = h.length; c < d; c++) h[c] != this.parentNode && g("select", h[c]).val(b);
                a._iDisplayLength = parseInt(b, 10);
                z(a);
                if (a.fnDisplayEnd() == a.fnRecordsDisplay() && (a._iDisplayStart = a.fnDisplayEnd() - a._iDisplayLength, a._iDisplayStart < 0)) a._iDisplayStart = 0;
                if (a._iDisplayLength == -1) a._iDisplayStart = 0;
                y(a)
            });
            return h
        }
        function ya(a) {
            var b = l.createElement("div");
            a.sTableId !== "" && typeof a.aanFeatures.r == "undefined" && b.setAttribute("id", a.sTableId + "_processing");
            b.innerHTML = a.oLanguage.sProcessing;
            b.className = a.oClasses.sProcessing;
            a.nTable.parentNode.insertBefore(b, a.nTable);
            return b
        }
        function C(a, b) {
            if (a.oFeatures.bProcessing) for (var c = a.aanFeatures.r, d = 0, h = c.length; d < h; d++) c[d].style.visibility = b ? "visible" : "hidden"
        }
        function Da(a, b) {
            for (var c = -1, d = 0; d < a.aoColumns.length; d++) if (a.aoColumns[d].bVisible === !0 && c++, c == b) return d;
            return null
        }
        function ja(a, b) {
            for (var c = -1, d = 0; d < a.aoColumns.length; d++) if (a.aoColumns[d].bVisible === !0 && c++, d == b) return a.aoColumns[d].bVisible === !0 ? c : null;
            return null
        }
        function L(a, b) {
            var c, d;
            for (c = a._iDisplayStart, d = a._iDisplayEnd; c < d; c++) if (a.aoData[a.aiDisplay[c]].nTr == b) return a.aiDisplay[c];
            for (c = 0, d = a.aoData.length; c < d; c++) if (a.aoData[c].nTr == b) return c;
            return null
        }
        function Q(a) {
            for (var b = 0, c = 0; c < a.aoColumns.length; c++) a.aoColumns[c].bVisible === !0 && b++;
            return b
        }
        function z(a) {
            a._iDisplayEnd = a.oFeatures.bPaginate === !1 ? a.aiDisplay.length : a._iDisplayStart + a._iDisplayLength > a.aiDisplay.length || a._iDisplayLength == -1 ? a.aiDisplay.length : a._iDisplayStart + a._iDisplayLength
        }
        function Ia(a, b) {
            if (!a || a === null || a === "") return 0;
            typeof b == "undefined" && (b = l.getElementsByTagName("body")[0]);
            var c, d = l.createElement("div");
            d.style.width = o(a);
            b.appendChild(d);
            c = d.offsetWidth;
            b.removeChild(d);
            return c
        }
        function Y(a) {
            var b = 0,
                c, d = 0,
                h = a.aoColumns.length,
                f, e = g("th", a.nTHead);
            for (f = 0; f < h; f++) if (a.aoColumns[f].bVisible && (d++, a.aoColumns[f].sWidth !== null)) {
                c = Ia(a.aoColumns[f].sWidthOrig, a.nTable.parentNode);
                if (c !== null) a.aoColumns[f].sWidth = o(c);
                b++
            }
            if (h == e.length && b === 0 && d == h && a.oScroll.sX === "" && a.oScroll.sY === "") for (f = 0; f < a.aoColumns.length; f++) {
                if (c = g(e[f]).width(), c !== null) a.aoColumns[f].sWidth = o(c)
            } else {
                b = a.nTable.cloneNode(!1);
                f = a.nTHead.cloneNode(!0);
                d = l.createElement("tbody");
                c = l.createElement("tr");
                b.removeAttribute("id");
                b.appendChild(f);
                a.nTFoot !== null && (b.appendChild(a.nTFoot.cloneNode(!0)), G(function (a) {
                    a.style.width = ""
                }, b.getElementsByTagName("tr")));
                b.appendChild(d);
                d.appendChild(c);
                d = g("thead th", b);
                d.length === 0 && (d = g("tbody tr:eq(0)>td", b));
                e = J(a, f);
                for (f = d = 0; f < h; f++) {
                    var i = a.aoColumns[f];
                    i.bVisible && i.sWidthOrig !== null && i.sWidthOrig !== "" ? e[f - d].style.width = o(i.sWidthOrig) : i.bVisible ? e[f - d].style.width = "" : d++
                }
                for (f = 0; f < h; f++) a.aoColumns[f].bVisible && (d = Ja(a, f), d !== null && (d = d.cloneNode(!0), a.aoColumns[f].sContentPadding !== "" && (d.innerHTML += a.aoColumns[f].sContentPadding), c.appendChild(d)));
                h = a.nTable.parentNode;
                h.appendChild(b);
                if (a.oScroll.sX !== "" && a.oScroll.sXInner !== "") b.style.width = o(a.oScroll.sXInner);
                else if (a.oScroll.sX !== "") {
                    if (b.style.width = "", g(b).width() < h.offsetWidth) b.style.width = o(h.offsetWidth)
                } else if (a.oScroll.sY !== "") b.style.width = o(h.offsetWidth);
                b.style.visibility = "hidden";
                Ka(a, b);
                h = g("tbody tr:eq(0)", b).children();
                h.length === 0 && (h = J(a, g("thead", b)[0]));
                if (a.oScroll.sX !== "") {
                    for (f = d = c = 0; f < a.aoColumns.length; f++) a.aoColumns[f].bVisible && (c += a.aoColumns[f].sWidthOrig === null ? g(h[d]).outerWidth() : parseInt(a.aoColumns[f].sWidth.replace("px", ""), 10) + (g(h[d]).outerWidth() - g(h[d]).width()), d++);
                    b.style.width = o(c);
                    a.nTable.style.width = o(c)
                }
                for (f = d = 0; f < a.aoColumns.length; f++) if (a.aoColumns[f].bVisible) {
                    c = g(h[d]).width();
                    if (c !== null && c > 0) a.aoColumns[f].sWidth = o(c);
                    d++
                }
                a.nTable.style.width = o(g(b).outerWidth());
                b.parentNode.removeChild(b)
            }
        }
        function Ka(a, b) {
            if (a.oScroll.sX === "" && a.oScroll.sY !== "") g(b).width(), b.style.width = o(g(b).outerWidth() - a.oScroll.iBarWidth);
            else if (a.oScroll.sX !== "") b.style.width = o(g(b).outerWidth())
        }
        function Ja(a, b) {
            var c = La(a, b);
            if (c < 0) return null;
            if (a.aoData[c].nTr === null) {
                var d = l.createElement("td");
                d.innerHTML = A(a, c, b, "");
                return d
            }
            return H(a, c)[b]
        }
        function La(a, b) {
            for (var c = -1, d = -1, h = 0; h < a.aoData.length; h++) {
                var f = A(a, h, b, "display") + "",
                    f = f.replace(/<.*?>/g, "");
                if (f.length > c) c = f.length, d = h
            }
            return d
        }
        function o(a) {
            if (a === null) return "0px";
            if (typeof a == "number") return a < 0 ? "0px" : a + "px";
            var b = a.charCodeAt(a.length - 1);
            return b < 48 || b > 57 ? a : a + "px"
        }
        function $(a) {
            for (var b = i.aTypes, c = b.length, d = 0; d < c; d++) {
                var h = b[d](a);
                if (h !== null) return h
            }
            return "string"
        }
        function w(a) {
            for (var b = 0; b < q.length; b++) if (q[b].nTable == a) return q[b];
            return null
        }
        function U(a) {
            for (var b = [], c = a.aoData.length, d = 0; d < c; d++) b.push(a.aoData[d]._aData);
            return b
        }
        function T(a) {
            for (var b = [], c = 0, d = a.aoData.length; c < d; c++) a.aoData[c].nTr !== null && b.push(a.aoData[c].nTr);
            return b
        }
        function H(a, b) {
            var c = [],
                d, h, f, e, g, i;
            h = 0;
            var j = a.aoData.length;
            typeof b != "undefined" && (h = b, j = b + 1);
            for (f = h; f < j; f++) if (i = a.aoData[f], i.nTr !== null) {
                h = [];
                for (e = 0, g = i.nTr.childNodes.length; e < g; e++) d = i.nTr.childNodes[e].nodeName.toLowerCase(), (d == "td" || d == "th") && h.push(i.nTr.childNodes[e]);
                d = 0;
                for (e = 0, g = a.aoColumns.length; e < g; e++) a.aoColumns[e].bVisible ? c.push(h[e - d]) : (c.push(i._anHidden[e]), d++)
            }
            return c
        }
        function ia(a) {
            return a.replace(/(\/|\.|\*|\+|\?|\||\(|\)|\[|\]|\{|\}|\\|\$|\^)/g, "\\$1")
        }
        function ka(a, b) {
            for (var c = -1, d = 0, h = a.length; d < h; d++) a[d] == b ? c = d : a[d] > b && a[d]--;
            c != -1 && a.splice(c, 1)
        }
        function va(a, b) {
            for (var c = b.split(","), d = [], h = 0, f = a.aoColumns.length; h < f; h++) for (var e = 0; e < f; e++) if (a.aoColumns[h].sName == c[e]) {
                d.push(e);
                break
            }
            return d
        }
        function ba(a) {
            for (var b = "", c = 0, d = a.aoColumns.length; c < d; c++) b += a.aoColumns[c].sName + ",";
            return b.length == d ? "" : b.slice(0, -1)
        }
        function B(a, b, c) {
            a = a.sTableId === "" ? "DataTables warning: " + c : "DataTables warning (table id = '" + a.sTableId + "'): " + c;
            if (b === 0) if (i.sErrMode == "alert") alert(a);
            else throw a;
            else typeof console != "undefined" && typeof console.log != "undefined" && console.log(a)
        }
        function ca(a) {
            a.aoData.splice(0, a.aoData.length);
            a.aiDisplayMaster.splice(0, a.aiDisplayMaster.length);
            a.aiDisplay.splice(0, a.aiDisplay.length);
            z(a)
        }
        function la(a) {
            if (a.oFeatures.bStateSave && typeof a.bDestroying == "undefined") {
                var b, c, d, e = "{";
                e += '"iCreate":' + (new Date).getTime() + ",";
                e += '"iStart":' + (a.oScroll.bInfinite ? 0 : a._iDisplayStart) + ",";
                e += '"iEnd":' + (a.oScroll.bInfinite ? a._iDisplayLength : a._iDisplayEnd) + ",";
                e += '"iLength":' + a._iDisplayLength + ",";
                e += '"sFilter":"' + encodeURIComponent(a.oPreviousSearch.sSearch) + '",';
                e += '"sFilterEsc":' + !a.oPreviousSearch.bRegex + ",";
                e += '"aaSorting":[ ';
                for (b = 0; b < a.aaSorting.length; b++) e += "[" + a.aaSorting[b][0] + ',"' + a.aaSorting[b][1] + '"],';
                e = e.substring(0, e.length - 1);
                e += "],";
                e += '"aaSearchCols":[ ';
                for (b = 0; b < a.aoPreSearchCols.length; b++) e += '["' + encodeURIComponent(a.aoPreSearchCols[b].sSearch) + '",' + !a.aoPreSearchCols[b].bRegex + "],";
                e = e.substring(0, e.length - 1);
                e += "],";
                e += '"abVisCols":[ ';
                for (b = 0; b < a.aoColumns.length; b++) e += a.aoColumns[b].bVisible + ",";
                e = e.substring(0, e.length - 1);
                e += "]";
                for (b = 0, c = a.aoStateSave.length; b < c; b++) d = a.aoStateSave[b].fn(a, e), d !== "" && (e = d);
                e += "}";
                Ma(a.sCookiePrefix + a.sInstance, e, a.iCookieDuration, a.sCookiePrefix, a.fnCookieCallback)
            }
        }

        function Na(a, b) {
            if (a.oFeatures.bStateSave) {
                var c, d, e;
                d = ma(a.sCookiePrefix + a.sInstance);
                if (d !== null && d !== "") {
                    try {
                        c = typeof g.parseJSON == "function" ? g.parseJSON(d.replace(/'/g, '"')) : eval("(" + d + ")")
                    } catch (f) {
                        return
                    }
                    for (d = 0, e = a.aoStateLoad.length; d < e; d++) if (!a.aoStateLoad[d].fn(a, c)) return;
                    a.oLoadedState = g.extend(!0, {}, c);
                    a._iDisplayStart = c.iStart;
                    a.iInitDisplayStart = c.iStart;
                    a._iDisplayEnd = c.iEnd;
                    a._iDisplayLength = c.iLength;
                    a.oPreviousSearch.sSearch = decodeURIComponent(c.sFilter);
                    a.aaSorting = c.aaSorting.slice();
                    a.saved_aaSorting = c.aaSorting.slice();
                    if (typeof c.sFilterEsc != "undefined") a.oPreviousSearch.bRegex = !c.sFilterEsc;
                    if (typeof c.aaSearchCols != "undefined") for (d = 0; d < c.aaSearchCols.length; d++) a.aoPreSearchCols[d] = {
                        sSearch: decodeURIComponent(c.aaSearchCols[d][0]),
                        bRegex: !c.aaSearchCols[d][1]
                    };
                    if (typeof c.abVisCols != "undefined") {
                        b.saved_aoColumns = [];
                        for (d = 0; d < c.abVisCols.length; d++) b.saved_aoColumns[d] = {}, b.saved_aoColumns[d].bVisible = c.abVisCols[d]
                    }
                }
            }
        }
        function Ma(a, b, c, d, e) {
            var f = new Date;
            f.setTime(f.getTime() + c * 1E3);
            var c = pa.location.pathname.split("/"),
                a = a + "_" + c.pop().replace(/[\/:]/g, "").toLowerCase(),
                i;
            e !== null ? (i = typeof g.parseJSON == "function" ? g.parseJSON(b) : eval("(" + b + ")"), b = e(a, i, f.toGMTString(), c.join("/") + "/")) : b = a + "=" + encodeURIComponent(b) + "; expires=" + f.toGMTString() + "; path=" + c.join("/") + "/";
            e = "";
            f = 9999999999999;
            if ((ma(a) !== null ? l.cookie.length : b.length + l.cookie.length) + 10 > 4096) {
                for (var a = l.cookie.split(";"), j = 0, k = a.length; j < k; j++) if (a[j].indexOf(d) != -1) {
                    var n = a[j].split("=");
                    try {
                        i = eval("(" + decodeURIComponent(n[1]) + ")")
                    } catch (m) {
                        continue
                    }
                    if (typeof i.iCreate != "undefined" && i.iCreate < f) e = n[0], f = i.iCreate
                }
                if (e !== "") l.cookie = e + "=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=" + c.join("/") + "/"
            }
            l.cookie = b
        }
        function ma(a) {
            for (var b = pa.location.pathname.split("/"), a = a + "_" + b[b.length - 1].replace(/[\/:]/g, "").toLowerCase() + "=", b = l.cookie.split(";"), c = 0; c < b.length; c++) {
                for (var d = b[c]; d.charAt(0) == " ";) d = d.substring(1, d.length);
                if (d.indexOf(a) === 0) return decodeURIComponent(d.substring(a.length, d.length))
            }
            return null
        }

        function P(a, b) {
            var c = g(b).children("tr"),
                d, e, f, i, j, k, l, m, o = function (a, b, c) {
                    for (; typeof a[b][c] != "undefined";) c++;
                    return c
                };
            a.splice(0, a.length);
            for (e = 0, k = c.length; e < k; e++) a.push([]);
            for (e = 0, k = c.length; e < k; e++) for (f = 0, l = c[e].childNodes.length; f < l; f++) if (d = c[e].childNodes[f], d.nodeName.toUpperCase() == "TD" || d.nodeName.toUpperCase() == "TH") {
                var p = d.getAttribute("colspan") * 1,
                    q = d.getAttribute("rowspan") * 1,
                    p = !p || p === 0 || p === 1 ? 1 : p,
                    q = !q || q === 0 || q === 1 ? 1 : q;
                m = o(a, e, 0);
                for (j = 0; j < p; j++) for (i = 0; i < q; i++) a[e + i][m + j] = {
                    cell: d,
                    unique: p == 1 ? !0 : !1
                }, a[e + i].nTr = c[e]
            }
        }
        function J(a, b, c) {
            var d = [];
            if (typeof c == "undefined") c = a.aoHeader, typeof b != "undefined" && (c = [], P(c, b));
            for (var b = 0, e = c.length; b < e; b++) for (var f = 0, g = c[b].length; f < g; f++) if (c[b][f].unique && (typeof d[f] == "undefined" || !a.bSortCellsTop)) d[f] = c[b][f].cell;
            return d
        }
        function Oa() {
            var a = l.createElement("p"),
                b = a.style;
            b.width = "100%";
            b.height = "200px";
            b.padding = "0px";
            var c = l.createElement("div"),
                b = c.style;
            b.position = "absolute";
            b.top = "0px";
            b.left = "0px";
            b.visibility = "hidden";
            b.width = "200px";
            b.height = "150px";
            b.padding = "0px";
            b.overflow = "hidden";
            c.appendChild(a);
            l.body.appendChild(c);
            b = a.offsetWidth;
            c.style.overflow = "scroll";
            a = a.offsetWidth;
            if (b == a) a = c.clientWidth;
            l.body.removeChild(c);
            return b - a
        }
        function G(a, b, c) {
            for (var d = 0, e = b.length; d < e; d++) for (var f = 0, g = b[d].childNodes.length; f < g; f++) b[d].childNodes[f].nodeType == 1 && (typeof c != "undefined" ? a(b[d].childNodes[f], c[d].childNodes[f]) : a(b[d].childNodes[f]))
        }
        function j(a, b, c, d) {
            typeof d == "undefined" && (d = c);
            typeof b[c] != "undefined" && (a[d] = b[c])
        }
        function X(a, b, c) {
            for (var d = [], e = 0, f = a.aoColumns.length; e < f; e++) d.push(A(a, b, e, c));
            return d
        }
        function A(a, b, c, d) {
            var e = a.aoColumns[c];
            if ((c = e.fnGetData(a.aoData[b]._aData)) === void 0) {
                if (a.iDrawError != a.iDraw && e.sDefaultContent === null) B(a, 0, "Requested unknown parameter '" + e.mDataProp + "' from the data source for row " + b), a.iDrawError = a.iDraw;
                return e.sDefaultContent
            }
            if (c === null && e.sDefaultContent !== null) c = e.sDefaultContent;
            else if (typeof c == "function") return c();
            return d == "display" && c === null ? "" : c
        }
        function F(a, b, c, d) {
            a.aoColumns[c].fnSetData(a.aoData[b]._aData, d)
        }
        function S(a) {
            if (a === null) return function () {
                return null
            };
            else if (typeof a == "function") return function (b) {
                return a(b)
            };
            else if (typeof a == "string" && a.indexOf(".") != -1) {
                var b = a.split(".");
                return b.length == 2 ?
                function (a) {
                    return a[b[0]][b[1]]
                } : b.length == 3 ?
                function (a) {
                    return a[b[0]][b[1]][b[2]]
                } : function (a) {
                    for (var d = 0, e = b.length; d < e; d++) a = a[b[d]];
                    return a
                }
            } else return function (b) {
                return b[a]
            }
        }
        function ra(a) {
            if (a === null) return function () {};
            else if (typeof a == "function") return function (b, d) {
                return a(b, d)
            };
            else if (typeof a == "string" && a.indexOf(".") != -1) {
                var b = a.split(".");
                return b.length == 2 ?
                function (a, d) {
                    a[b[0]][b[1]] = d
                } : b.length == 3 ?
                function (a, d) {
                    a[b[0]][b[1]][b[2]] = d
                } : function (a, d) {
                    for (var e = 0, f = b.length - 1; e < f; e++) a = a[b[e]];
                    a[b[b.length - 1]] = d
                }
            } else return function (b, d) {
                b[a] = d
            }
        }
        this.oApi = {};
        this.fnDraw = function (a) {
            var b = w(this[i.iApiIndex]);
            typeof a != "undefined" && a === !1 ? (z(b), y(b)) : V(b)
        };
        this.fnFilter = function (a, b, c, d, e) {
            var f = w(this[i.iApiIndex]);
            if (f.oFeatures.bFilter) if (typeof c == "undefined" && (c = !1), typeof d == "undefined" && (d = !0), typeof e == "undefined" && (e = !0), typeof b == "undefined" || b === null) {
                if (D(f, {
                    sSearch: a,
                    bRegex: c,
                    bSmart: d
                }, 1), e && typeof f.aanFeatures.f != "undefined") {
                    b = f.aanFeatures.f;
                    c = 0;
                    for (d = b.length; c < d; c++) g("input", b[c]).val(a)
                }
            } else f.aoPreSearchCols[b].sSearch = a, f.aoPreSearchCols[b].bRegex = c, f.aoPreSearchCols[b].bSmart = d, D(f, f.oPreviousSearch, 1)
        };
        this.fnSettings = function () {
            return w(this[i.iApiIndex])
        };
        this.fnVersionCheck = i.fnVersionCheck;
        this.fnSort = function (a) {
            var b = w(this[i.iApiIndex]);
            b.aaSorting = a;
            I(b)
        };
        this.fnSortListener = function (a, b, c) {
            aa(w(this[i.iApiIndex]), a, b, c)
        };
        this.fnAddData = function (a, b) {
            if (a.length === 0) return [];
            var c = [],
                d, e = w(this[i.iApiIndex]);
            if (typeof a[0] == "object") for (var f = 0; f < a.length; f++) {
                d = p(e, a[f]);
                if (d == -1) return c;
                c.push(d)
            } else {
                d = p(e, a);
                if (d == -1) return c;
                c.push(d)
            }
            e.aiDisplay = e.aiDisplayMaster.slice();
            (typeof b == "undefined" || b) && V(e);
            return c
        };
        this.fnDeleteRow = function (a, b, c) {
            var d = w(this[i.iApiIndex]),
                a = typeof a == "object" ? L(d, a) : a,
                e = d.aoData.splice(a, 1),
                f = g.inArray(a, d.aiDisplay);
            d.asDataSearch.splice(f, 1);
            ka(d.aiDisplayMaster, a);
            ka(d.aiDisplay, a);
            typeof b == "function" && b.call(this, d, e);
            if (d._iDisplayStart >= d.aiDisplay.length && (d._iDisplayStart -= d._iDisplayLength, d._iDisplayStart < 0)) d._iDisplayStart = 0;
            if (typeof c == "undefined" || c) z(d), y(d);
            return e
        };
        this.fnClearTable = function (a) {
            var b = w(this[i.iApiIndex]);
            ca(b);
            (typeof a == "undefined" || a) && y(b)
        };
        this.fnOpen = function (a, b, c) {
            var d = w(this[i.iApiIndex]);
            this.fnClose(a);
            var e = l.createElement("tr"),
                f = l.createElement("td");
            e.appendChild(f);
            f.className = c;
            f.colSpan = Q(d);
            typeof b.jquery != "undefined" || typeof b == "object" ? f.appendChild(b) : f.innerHTML = b;
            b = g("tr", d.nTBody);
            g.inArray(a, b) != -1 && g(e).insertAfter(a);
            d.aoOpenRows.push({
                nTr: e,
                nParent: a
            });
            return e
        };
        this.fnClose = function (a) {
            for (var b = w(this[i.iApiIndex]), c = 0; c < b.aoOpenRows.length; c++) if (b.aoOpenRows[c].nParent == a) return (a = b.aoOpenRows[c].nTr.parentNode) && a.removeChild(b.aoOpenRows[c].nTr), b.aoOpenRows.splice(c, 1), 0;
            return 1
        };
        this.fnGetData = function (a, b) {
            var c = w(this[i.iApiIndex]);
            if (typeof a != "undefined") {
                var d = typeof a == "object" ? L(c, a) : a;
                return typeof b != "undefined" ? A(c, d, b, "") : typeof c.aoData[d] != "undefined" ? c.aoData[d]._aData : null
            }
            return U(c)
        };
        this.fnGetNodes = function (a) {
            var b = w(this[i.iApiIndex]);
            return typeof a != "undefined" ? typeof b.aoData[a] != "undefined" ? b.aoData[a].nTr : null : T(b)
        };
        this.fnGetPosition = function (a) {
            var b = w(this[i.iApiIndex]),
                c = a.nodeName.toUpperCase();
            if (c == "TR") return L(b, a);
            else if (c == "TD" || c == "TH") for (var c = L(b, a.parentNode), d = H(b, c), e = 0; e < b.aoColumns.length; e++) if (d[e] == a) return [c, ja(b, e), e];
            return null
        };
        this.fnUpdate = function (a, b, c, d, e) {
            var f = w(this[i.iApiIndex]),
                b = typeof b == "object" ? L(f, b) : b;
            if (g.isArray(a) && typeof a == "object") {
                f.aoData[b]._aData = a.slice();
                for (c = 0; c < f.aoColumns.length; c++) this.fnUpdate(A(f, b, c), b, c, !1, !1)
            } else if (a !== null && typeof a == "object") {
                f.aoData[b]._aData = g.extend(!0, {}, a);
                for (c = 0; c < f.aoColumns.length; c++) this.fnUpdate(A(f, b, c), b, c, !1, !1)
            } else if (F(f, b, c, a), f.aoColumns[c].fnRender !== null && (a = f.aoColumns[c].fnRender({
                iDataRow: b,
                iDataColumn: c,
                aData: f.aoData[b]._aData,
                oSettings: f
            }), f.aoColumns[c].bUseRendered && F(f, b, c, a)), f.aoData[b].nTr !== null) H(f, b)[c].innerHTML = a;
            c = g.inArray(b, f.aiDisplay);
            f.asDataSearch[c] = ha(f, X(f, b, "filter"));
            (typeof e == "undefined" || e) && W(f);
            (typeof d == "undefined" || d) && V(f);
            return 0
        };
        this.fnSetColumnVis = function (a, b, c) {
            var d = w(this[i.iApiIndex]),
                e, f;
            f = d.aoColumns.length;
            var g, j;
            if (d.aoColumns[a].bVisible != b) {
                if (b) {
                    for (e = j = 0; e < a; e++) d.aoColumns[e].bVisible && j++;
                    j = j >= Q(d);
                    if (!j) for (e = a; e < f; e++) if (d.aoColumns[e].bVisible) {
                        g = e;
                        break
                    }
                    for (e = 0, f = d.aoData.length; e < f; e++) d.aoData[e].nTr !== null && (j ? d.aoData[e].nTr.appendChild(d.aoData[e]._anHidden[a]) : d.aoData[e].nTr.insertBefore(d.aoData[e]._anHidden[a], H(d, e)[g]))
                } else for (e = 0, f = d.aoData.length; e < f; e++) d.aoData[e].nTr !== null && (g = H(d, e)[a], d.aoData[e]._anHidden[a] = g, g.parentNode.removeChild(g));
                d.aoColumns[a].bVisible = b;
                N(d, d.aoHeader);
                d.nTFoot && N(d, d.aoFooter);
                for (e = 0, f = d.aoOpenRows.length; e < f; e++) d.aoOpenRows[e].nTr.colSpan = Q(d);
                if (typeof c == "undefined" || c) W(d), y(d);
                la(d)
            }
        };
        this.fnPageChange = function (a, b) {
            var c = w(this[i.iApiIndex]);
            da(c, a);
            z(c);
            (typeof b == "undefined" || b) && y(c)
        };
        this.fnDestroy = function () {
            var a = w(this[i.iApiIndex]),
                b = a.nTableWrapper.parentNode,
                c = a.nTBody,
                d, e;
            a.bDestroying = !0;
            for (d = 0, e = a.aoDestroyCallback.length; d < e; d++) a.aoDestroyCallback[d].fn();
            for (d = 0, e = a.aoColumns.length; d < e; d++) a.aoColumns[d].bVisible === !1 && this.fnSetColumnVis(d, !0);
            g(a.nTableWrapper).find("*").andSelf().unbind(".DT");
            g("tbody>tr>td." + a.oClasses.sRowEmpty, a.nTable).parent().remove();
            a.nTable != a.nTHead.parentNode && (g(a.nTable).children("thead").remove(), a.nTable.appendChild(a.nTHead));
            a.nTFoot && a.nTable != a.nTFoot.parentNode && (g(a.nTable).children("tfoot").remove(), a.nTable.appendChild(a.nTFoot));
            a.nTable.parentNode.removeChild(a.nTable);
            g(a.nTableWrapper).remove();
            a.aaSorting = [];
            a.aaSortingFixed = [];
            K(a);
            g(T(a)).removeClass(a.asStripeClasses.join(" "));
            a.bJUI ? (g("th", a.nTHead).removeClass([i.oStdClasses.sSortable, i.oJUIClasses.sSortableAsc, i.oJUIClasses.sSortableDesc, i.oJUIClasses.sSortableNone].join(" ")), g("th span." + i.oJUIClasses.sSortIcon, a.nTHead).remove(), g("th", a.nTHead).each(function () {
                var a = g("div." + i.oJUIClasses.sSortJUIWrapper, this),
                    b = a.contents();
                g(this).append(b);
                a.remove()
            })) : g("th", a.nTHead).removeClass([i.oStdClasses.sSortable, i.oStdClasses.sSortableAsc, i.oStdClasses.sSortableDesc, i.oStdClasses.sSortableNone].join(" "));
            a.nTableReinsertBefore ? b.insertBefore(a.nTable, a.nTableReinsertBefore) : b.appendChild(a.nTable);
            for (d = 0, e = a.aoData.length; d < e; d++) a.aoData[d].nTr !== null && c.appendChild(a.aoData[d].nTr);
            if (a.oFeatures.bAutoWidth === !0) a.nTable.style.width = o(a.sDestroyWidth);
            g(c).children("tr:even").addClass(a.asDestroyStripes[0]);
            g(c).children("tr:odd").addClass(a.asDestroyStripes[1]);
            for (d = 0, e = q.length; d < e; d++) q[d] == a && q.splice(d, 1);
            a = null
        };
        this.fnAdjustColumnSizing = function (a) {
            var b = w(this[i.iApiIndex]);
            W(b);
            typeof a == "undefined" || a ? this.fnDraw(!1) : (b.oScroll.sX !== "" || b.oScroll.sY !== "") && this.oApi._fnScrollDraw(b)
        };
        for (var na in i.oApi) na && (this[na] = t(na));
        this.oApi._fnExternApiFunc = t;
        this.oApi._fnInitialise = k;
        this.oApi._fnInitComplete = m;
        this.oApi._fnLanguageProcess = x;
        this.oApi._fnAddColumn = M;
        this.oApi._fnColumnOptions = u;
        this.oApi._fnAddData = p;
        this.oApi._fnCreateTr = s;
        this.oApi._fnGatherData = R;
        this.oApi._fnBuildHead = O;
        this.oApi._fnDrawHead = N;
        this.oApi._fnDraw = y;
        this.oApi._fnReDraw = V;
        this.oApi._fnAjaxUpdate = sa;
        this.oApi._fnAjaxParameters = ta;
        this.oApi._fnAjaxUpdateDraw = ua;
        this.oApi._fnServerParams = Z;
        this.oApi._fnAddOptionsHtml = qa;
        this.oApi._fnFeatureHtmlTable = za;
        this.oApi._fnScrollDraw = Ca;
        this.oApi._fnAdjustColumnSizing = W;
        this.oApi._fnFeatureHtmlFilter = xa;
        this.oApi._fnFilterComplete = D;
        this.oApi._fnFilterCustom = Ga;
        this.oApi._fnFilterColumn = Fa;
        this.oApi._fnFilter = Ea;
        this.oApi._fnBuildSearchArray = ea;
        this.oApi._fnBuildSearchRow = ha;
        this.oApi._fnFilterCreateSearch = fa;
        this.oApi._fnDataToSearch = ga;
        this.oApi._fnSort = I;
        this.oApi._fnSortAttachListener = aa;
        this.oApi._fnSortingClasses = K;
        this.oApi._fnFeatureHtmlPaginate = Ba;
        this.oApi._fnPageChange = da;
        this.oApi._fnFeatureHtmlInfo = Aa;
        this.oApi._fnUpdateInfo = Ha;
        this.oApi._fnFeatureHtmlLength = wa;
        this.oApi._fnFeatureHtmlProcessing = ya;
        this.oApi._fnProcessingDisplay = C;
        this.oApi._fnVisibleToColumnIndex = Da;
        this.oApi._fnColumnIndexToVisible = ja;
        this.oApi._fnNodeToDataIndex = L;
        this.oApi._fnVisbleColumns = Q;
        this.oApi._fnCalculateEnd = z;
        this.oApi._fnConvertToWidth = Ia;
        this.oApi._fnCalculateColumnWidths = Y;
        this.oApi._fnScrollingWidthAdjust = Ka;
        this.oApi._fnGetWidestNode = Ja;
        this.oApi._fnGetMaxLenString = La;
        this.oApi._fnStringToCss = o;
        this.oApi._fnArrayCmp = function (a, b) {
            if (a.length != b.length) return 1;
            for (var c = 0; c < a.length; c++) if (a[c] != b[c]) return 2;
            return 0
        };
        this.oApi._fnDetectType = $;
        this.oApi._fnSettingsFromNode = w;
        this.oApi._fnGetDataMaster = U;
        this.oApi._fnGetTrNodes = T;
        this.oApi._fnGetTdNodes = H;
        this.oApi._fnEscapeRegex = ia;
        this.oApi._fnDeleteIndex = ka;
        this.oApi._fnReOrderIndex = va;
        this.oApi._fnColumnOrdering = ba;
        this.oApi._fnLog = B;
        this.oApi._fnClearTable = ca;
        this.oApi._fnSaveState = la;
        this.oApi._fnLoadState = Na;
        this.oApi._fnCreateCookie = Ma;
        this.oApi._fnReadCookie = ma;
        this.oApi._fnDetectHeader = P;
        this.oApi._fnGetUniqueThs = J;
        this.oApi._fnScrollBarWidth = Oa;
        this.oApi._fnApplyToChildren = G;
        this.oApi._fnMap = j;
        this.oApi._fnGetRowData = X;
        this.oApi._fnGetCellData = A;
        this.oApi._fnSetCellData = F;
        this.oApi._fnGetObjectDataFn = S;
        this.oApi._fnSetObjectDataFn = ra;
        var oa = this;
        return this.each(function () {
            var a = 0,
                b, c, d, h;
            for (a = 0, b = q.length; a < b; a++) {
                if (q[a].nTable == this) if (typeof e == "undefined" || typeof e.bRetrieve != "undefined" && e.bRetrieve === !0) return q[a].oInstance;
                else if (typeof e.bDestroy != "undefined" && e.bDestroy === !0) {
                    q[a].oInstance.fnDestroy();
                    break
                } else {
                    B(q[a], 0, "Cannot reinitialise DataTable.\n\nTo retrieve the DataTables object for this table, please pass either no arguments to the dataTable() function, or set bRetrieve to true. Alternatively, to destory the old table and create a new one, set bDestroy to true (note that a lot of changes to the configuration can be made through the API which is usually much faster).");
                    return
                }
                if (q[a].sTableId !== "" && q[a].sTableId == this.getAttribute("id")) {
                    q.splice(a, 1);
                    break
                }
            }
            var f = new Pa;
            q.push(f);
            var m = !1,
                o = !1,
                a = this.getAttribute("id");
            a !== null ? (f.sTableId = a, f.sInstance = a) : f.sInstance = i._oExternConfig.iNextUnique++;
            if (this.nodeName.toLowerCase() != "table") B(f, 0, "Attempted to initialise DataTables on a node which is not a table: " + this.nodeName);
            else {
                f.nTable = this;
                f.oInstance = oa.length == 1 ? oa : g(this).dataTable();
                f.oApi = oa.oApi;
                f.sDestroyWidth = g(this).width();
                if (typeof e != "undefined" && e !== null) {
                    f.oInit = e;
                    j(f.oFeatures, e, "bPaginate");
                    j(f.oFeatures, e, "bLengthChange");
                    j(f.oFeatures, e, "bFilter");
                    j(f.oFeatures, e, "bSort");
                    j(f.oFeatures, e, "bInfo");
                    j(f.oFeatures, e, "bProcessing");
                    j(f.oFeatures, e, "bAutoWidth");
                    j(f.oFeatures, e, "bSortClasses");
                    j(f.oFeatures, e, "bServerSide");
                    j(f.oFeatures, e, "bDeferRender");
                    j(f.oScroll, e, "sScrollX", "sX");
                    j(f.oScroll, e, "sScrollXInner", "sXInner");
                    j(f.oScroll, e, "sScrollY", "sY");
                    j(f.oScroll, e, "bScrollCollapse", "bCollapse");
                    j(f.oScroll, e, "bScrollInfinite", "bInfinite");
                    j(f.oScroll, e, "iScrollLoadGap", "iLoadGap");
                    j(f.oScroll, e, "bScrollAutoCss", "bAutoCss");
                    j(f, e, "asStripClasses", "asStripeClasses");
                    j(f, e, "asStripeClasses");
                    j(f, e, "fnPreDrawCallback");
                    j(f, e, "fnRowCallback");
                    j(f, e, "fnHeaderCallback");
                    j(f, e, "fnFooterCallback");
                    j(f, e, "fnCookieCallback");
                    j(f, e, "fnInitComplete");
                    j(f, e, "fnServerData");
                    j(f, e, "fnFormatNumber");
                    j(f, e, "aaSorting");
                    j(f, e, "aaSortingFixed");
                    j(f, e, "aLengthMenu");
                    j(f, e, "sPaginationType");
                    j(f, e, "sAjaxSource");
                    j(f, e, "sAjaxDataProp");
                    j(f, e, "iCookieDuration");
                    j(f, e, "sCookiePrefix");
                    j(f, e, "sDom");
                    j(f, e, "bSortCellsTop");
                    j(f, e, "oSearch", "oPreviousSearch");
                    j(f, e, "aoSearchCols", "aoPreSearchCols");
                    j(f, e, "iDisplayLength", "_iDisplayLength");
                    j(f, e, "bJQueryUI", "bJUI");
                    j(f.oLanguage, e, "fnInfoCallback");
                    typeof e.fnDrawCallback == "function" && f.aoDrawCallback.push({
                        fn: e.fnDrawCallback,
                        sName: "user"
                    });
                    typeof e.fnServerParams == "function" && f.aoServerParams.push({
                        fn: e.fnServerParams,
                        sName: "user"
                    });
                    typeof e.fnStateSaveCallback == "function" && f.aoStateSave.push({
                        fn: e.fnStateSaveCallback,
                        sName: "user"
                    });
                    typeof e.fnStateLoadCallback == "function" && f.aoStateLoad.push({
                        fn: e.fnStateLoadCallback,
                        sName: "user"
                    });
                    f.oFeatures.bServerSide && f.oFeatures.bSort && f.oFeatures.bSortClasses ? f.aoDrawCallback.push({
                        fn: K,
                        sName: "server_side_sort_classes"
                    }) : f.oFeatures.bDeferRender && f.aoDrawCallback.push({
                        fn: K,
                        sName: "defer_sort_classes"
                    });
                    if (typeof e.bJQueryUI != "undefined" && e.bJQueryUI && (f.oClasses = i.oJUIClasses, typeof e.sDom == "undefined")) f.sDom = '<"H"lfr>t<"F"ip>';
                    if (f.oScroll.sX !== "" || f.oScroll.sY !== "") f.oScroll.iBarWidth = Oa();
                    if (typeof e.iDisplayStart != "undefined" && typeof f.iInitDisplayStart == "undefined") f.iInitDisplayStart = e.iDisplayStart, f._iDisplayStart = e.iDisplayStart;
                    if (typeof e.bStateSave != "undefined") f.oFeatures.bStateSave = e.bStateSave, Na(f, e), f.aoDrawCallback.push({
                        fn: la,
                        sName: "state_save"
                    });
                    if (typeof e.iDeferLoading != "undefined") f.bDeferLoading = !0, f._iRecordsTotal = e.iDeferLoading, f._iRecordsDisplay = e.iDeferLoading;
                    typeof e.aaData != "undefined" && (o = !0);
                    if (typeof e != "undefined" && typeof e.aoData != "undefined") e.aoColumns = e.aoData;
                    if (typeof e.oLanguage != "undefined") typeof e.oLanguage.sUrl != "undefined" && e.oLanguage.sUrl !== "" ? (f.oLanguage.sUrl = e.oLanguage.sUrl, g.getJSON(f.oLanguage.sUrl, null, function (a) {
                        x(f, a, !0)
                    }), m = !0) : x(f, e.oLanguage, !1)
                } else e = {};
                typeof e.asStripClasses == "undefined" && typeof e.asStripeClasses == "undefined" && (f.asStripeClasses.push(f.oClasses.sStripeOdd), f.asStripeClasses.push(f.oClasses.sStripeEven));
                c = !1;
                d = g(this).children("tbody").children("tr");
                for (a = 0, b = f.asStripeClasses.length; a < b; a++) if (d.filter(":lt(2)").hasClass(f.asStripeClasses[a])) {
                    c = !0;
                    break
                }
                if (c) f.asDestroyStripes = ["", ""], g(d[0]).hasClass(f.oClasses.sStripeOdd) && (f.asDestroyStripes[0] += f.oClasses.sStripeOdd + " "), g(d[0]).hasClass(f.oClasses.sStripeEven) && (f.asDestroyStripes[0] += f.oClasses.sStripeEven), g(d[1]).hasClass(f.oClasses.sStripeOdd) && (f.asDestroyStripes[1] += f.oClasses.sStripeOdd + " "), g(d[1]).hasClass(f.oClasses.sStripeEven) && (f.asDestroyStripes[1] += f.oClasses.sStripeEven), d.removeClass(f.asStripeClasses.join(" "));
                c = [];
                var r, a = this.getElementsByTagName("thead");
                a.length !== 0 && (P(f.aoHeader, a[0]), c = J(f));
                if (typeof e.aoColumns == "undefined") {
                    r = [];
                    for (a = 0, b = c.length; a < b; a++) r.push(null)
                } else r = e.aoColumns;
                for (a = 0, b = r.length; a < b; a++) {
                    if (typeof e.saved_aoColumns != "undefined" && e.saved_aoColumns.length == b) r[a] === null && (r[a] = {}), r[a].bVisible = e.saved_aoColumns[a].bVisible;
                    M(f, c ? c[a] : null)
                }
                if (typeof e.aoColumnDefs != "undefined") for (a = e.aoColumnDefs.length - 1; a >= 0; a--) {
                    var n = e.aoColumnDefs[a].aTargets;
                    g.isArray(n) || B(f, 1, "aTargets must be an array of targets, not a " + typeof n);
                    for (c = 0, d = n.length; c < d; c++) if (typeof n[c] == "number" && n[c] >= 0) {
                        for (; f.aoColumns.length <= n[c];) M(f);
                        u(f, n[c], e.aoColumnDefs[a])
                    } else if (typeof n[c] == "number" && n[c] < 0) u(f, f.aoColumns.length + n[c], e.aoColumnDefs[a]);
                    else if (typeof n[c] == "string") for (b = 0, h = f.aoColumns.length; b < h; b++)(n[c] == "_all" || g(f.aoColumns[b].nTh).hasClass(n[c])) && u(f, b, e.aoColumnDefs[a])
                }
                if (typeof r != "undefined") for (a = 0, b = r.length; a < b; a++) u(f, a, r[a]);
                for (a = 0, b = f.aaSorting.length; a < b; a++) {
                    f.aaSorting[a][0] >= f.aoColumns.length && (f.aaSorting[a][0] = 0);
                    r = f.aoColumns[f.aaSorting[a][0]];
                    typeof f.aaSorting[a][2] == "undefined" && (f.aaSorting[a][2] = 0);
                    typeof e.aaSorting == "undefined" && typeof f.saved_aaSorting == "undefined" && (f.aaSorting[a][1] = r.asSorting[0]);
                    for (c = 0, d = r.asSorting.length; c < d; c++) if (f.aaSorting[a][1] == r.asSorting[c]) {
                        f.aaSorting[a][2] = c;
                        break
                    }
                }
                K(f);
                a = g(this).children("thead");
                a.length === 0 && (a = [l.createElement("thead")], this.appendChild(a[0]));
                f.nTHead = a[0];
                a = g(this).children("tbody");
                a.length === 0 && (a = [l.createElement("tbody")], this.appendChild(a[0]));
                f.nTBody = a[0];
                a = g(this).children("tfoot");
                if (a.length > 0) f.nTFoot = a[0], P(f.aoFooter, f.nTFoot);
                if (o) for (a = 0; a < e.aaData.length; a++) p(f, e.aaData[a]);
                else R(f);
                f.aiDisplay = f.aiDisplayMaster.slice();
                f.bInitialised = !0;
                m === !1 && k(f)
            }
        })
    }
})(jQuery, window, document);
jQuery.easing.jswing = jQuery.easing.swing;
jQuery.extend(jQuery.easing, {
    def: "easeOutQuad",
    swing: function (e, a, c, b, d) {
        return jQuery.easing[jQuery.easing.def](e, a, c, b, d)
    },
    easeInQuad: function (e, a, c, b, d) {
        return b * (a /= d) * a + c
    },
    easeOutQuad: function (e, a, c, b, d) {
        return -b * (a /= d) * (a - 2) + c
    },
    easeInOutQuad: function (e, a, c, b, d) {
        return (a /= d / 2) < 1 ? b / 2 * a * a + c : -b / 2 * (--a * (a - 2) - 1) + c
    },
    easeInCubic: function (e, a, c, b, d) {
        return b * (a /= d) * a * a + c
    },
    easeOutCubic: function (e, a, c, b, d) {
        return b * ((a = a / d - 1) * a * a + 1) + c
    },
    easeInOutCubic: function (e, a, c, b, d) {
        return (a /= d / 2) < 1 ? b / 2 * a * a * a + c : b / 2 * ((a -= 2) * a * a + 2) + c
    },
    easeInQuart: function (e, a, c, b, d) {
        return b * (a /= d) * a * a * a + c
    },
    easeOutQuart: function (e, a, c, b, d) {
        return -b * ((a = a / d - 1) * a * a * a - 1) + c
    },
    easeInOutQuart: function (e, a, c, b, d) {
        return (a /= d / 2) < 1 ? b / 2 * a * a * a * a + c : -b / 2 * ((a -= 2) * a * a * a - 2) + c
    },
    easeInQuint: function (e, a, c, b, d) {
        return b * (a /= d) * a * a * a * a + c
    },
    easeOutQuint: function (e, a, c, b, d) {
        return b * ((a = a / d - 1) * a * a * a * a + 1) + c
    },
    easeInOutQuint: function (e, a, c, b, d) {
        return (a /= d / 2) < 1 ? b / 2 * a * a * a * a * a + c : b / 2 * ((a -= 2) * a * a * a * a + 2) + c
    },
    easeInSine: function (e, a, c, b, d) {
        return -b * Math.cos(a / d * (Math.PI / 2)) + b + c
    },
    easeOutSine: function (e, a, c, b, d) {
        return b * Math.sin(a / d * (Math.PI / 2)) + c
    },
    easeInOutSine: function (e, a, c, b, d) {
        return -b / 2 * (Math.cos(Math.PI * a / d) - 1) + c
    },
    easeInExpo: function (e, a, c, b, d) {
        return a == 0 ? c : b * Math.pow(2, 10 * (a / d - 1)) + c
    },
    easeOutExpo: function (e, a, c, b, d) {
        return a == d ? c + b : b * (-Math.pow(2, -10 * a / d) + 1) + c
    },
    easeInOutExpo: function (e, a, c, b, d) {
        return a == 0 ? c : a == d ? c + b : (a /= d / 2) < 1 ? b / 2 * Math.pow(2, 10 * (a - 1)) + c : b / 2 * (-Math.pow(2, -10 * --a) + 2) + c
    },
    easeInCirc: function (e, a, c, b, d) {
        return -b * (Math.sqrt(1 - (a /= d) * a) - 1) + c
    },
    easeOutCirc: function (e, a, c, b, d) {
        return b * Math.sqrt(1 - (a = a / d - 1) * a) + c
    },
    easeInOutCirc: function (e, a, c, b, d) {
        return (a /= d / 2) < 1 ? -b / 2 * (Math.sqrt(1 - a * a) - 1) + c : b / 2 * (Math.sqrt(1 - (a -= 2) * a) + 1) + c
    },
    easeInElastic: function (e, a, c, b, d) {
        var e = 1.70158,
            f = 0,
            g = b;
        if (a == 0) return c;
        if ((a /= d) == 1) return c + b;
        f || (f = d * 0.3);
        g < Math.abs(b) ? (g = b, e = f / 4) : e = f / (2 * Math.PI) * Math.asin(b / g);
        return -(g * Math.pow(2, 10 * (a -= 1)) * Math.sin((a * d - e) * 2 * Math.PI / f)) + c
    },
    easeOutElastic: function (e, a, c, b, d) {
        var e = 1.70158,
            f = 0,
            g = b;
        if (a == 0) return c;
        if ((a /= d) == 1) return c + b;
        f || (f = d * 0.3);
        g < Math.abs(b) ? (g = b, e = f / 4) : e = f / (2 * Math.PI) * Math.asin(b / g);
        return g * Math.pow(2, -10 * a) * Math.sin((a * d - e) * 2 * Math.PI / f) + b + c
    },
    easeInOutElastic: function (e, a, c, b, d) {
        var e = 1.70158,
            f = 0,
            g = b;
        if (a == 0) return c;
        if ((a /= d / 2) == 2) return c + b;
        f || (f = d * 0.3 * 1.5);
        g < Math.abs(b) ? (g = b, e = f / 4) : e = f / (2 * Math.PI) * Math.asin(b / g);
        return a < 1 ? -0.5 * g * Math.pow(2, 10 * (a -= 1)) * Math.sin((a * d - e) * 2 * Math.PI / f) + c : g * Math.pow(2, -10 * (a -= 1)) * Math.sin((a * d - e) * 2 * Math.PI / f) * 0.5 + b + c
    },
    easeInBack: function (e, a, c, b, d, f) {
        f == void 0 && (f = 1.70158);
        return b * (a /= d) * a * ((f + 1) * a - f) + c
    },
    easeOutBack: function (e, a, c, b, d, f) {
        f == void 0 && (f = 1.70158);
        return b * ((a = a / d - 1) * a * ((f + 1) * a + f) + 1) + c
    },
    easeInOutBack: function (e, a, c, b, d, f) {
        f == void 0 && (f = 1.70158);
        return (a /= d / 2) < 1 ? b / 2 * a * a * (((f *= 1.525) + 1) * a - f) + c : b / 2 * ((a -= 2) * a * (((f *= 1.525) + 1) * a + f) + 2) + c
    },
    easeInBounce: function (e, a, c, b, d) {
        return b - jQuery.easing.easeOutBounce(e, d - a, 0, b, d) + c
    },
    easeOutBounce: function (e, a, c, b, d) {
        return (a /= d) < 1 / 2.75 ? b * 7.5625 * a * a + c : a < 2 / 2.75 ? b * (7.5625 * (a -= 1.5 / 2.75) * a + 0.75) + c : a < 2.5 / 2.75 ? b * (7.5625 * (a -= 2.25 / 2.75) * a + 0.9375) + c : b * (7.5625 * (a -= 2.625 / 2.75) * a + 0.984375) + c
    },
    easeInOutBounce: function (e, a, c, b, d) {
        return a < d / 2 ? jQuery.easing.easeInBounce(e, a * 2, 0, b, d) * 0.5 + c : jQuery.easing.easeOutBounce(e, a * 2 - d, 0, b, d) * 0.5 + b * 0.5 + c
    }
});
(function (a) {
    a.fn.equalHeights = function (c, b) {
        tallest = c ? c : 0;
        this.each(function () {
            a(this).height() > tallest && (tallest = a(this).height())
        });
        b && tallest > b && (tallest = b);
        return this.each(function () {
            a(this).height(tallest).css("overflow", "auto")
        })
    }
})(jQuery);
(function (a) {
    a.jGrowl = function (d, b) {
        a("#jGrowl").size() == 0 && a('<div id="jGrowl"></div>').addClass(b && b.position ? b.position : a.jGrowl.defaults.position).appendTo("body");
        a("#jGrowl").jGrowl(d, b)
    };
    a.fn.jGrowl = function (d, b) {
        if (a.isFunction(this.each)) {
            var e = arguments;
            return this.each(function () {
                a(this).data("jGrowl.instance") == void 0 && (a(this).data("jGrowl.instance", a.extend(new a.fn.jGrowl, {
                    notifications: [],
                    element: null,
                    interval: null
                })), a(this).data("jGrowl.instance").startup(this));
                return a.isFunction(a(this).data("jGrowl.instance")[d]) ? a(this).data("jGrowl.instance")[d].apply(a(this).data("jGrowl.instance"), a.makeArray(e).slice(1)) : a(this).data("jGrowl.instance").create(d, b)
            })
        }
    };
    a.extend(a.fn.jGrowl.prototype, {
        defaults: {
            pool: 0,
            header: "",
            group: "",
            sticky: !1,
            position: "top-right",
            glue: "after",
            theme: "default",
            themeState: "",
            corners: "10px",
            check: 250,
            life: 3E3,
            closeDuration: "normal",
            openDuration: "normal",
            easing: "linear",
            closer: !0,
            closeTemplate: "&times;",
            closerTemplate: "<div>[ close all ]</div>",
            log: function () {},
            beforeOpen: function () {},
            afterOpen: function () {},
            open: function () {},
            beforeClose: function () {},
            close: function () {},
            animateOpen: {
                height: "show"
            },
            animateClose: {
                opacity: "hide"
            }
        },
        notifications: [],
        element: null,
        interval: null,
        create: function (d, b) {
            b = a.extend({}, this.defaults, b);
            if (typeof b.speed !== "undefined") b.openDuration = b.speed, b.closeDuration = b.speed;
            this.notifications.push({
                message: d,
                options: b
            });
            b.log.apply(this.element, [this.element, d, b])
        },
        render: function (d) {
            var b = this,
                e = d.message,
                c = d.options;
            c.themeState = c.themeState == "" ? "" : "ui-state-" + c.themeState;
            d = a('<div class="jGrowl-notification ' + c.themeState + (c.group != void 0 && c.group != "" ? " " + c.group : "") + '"><div class="jGrowl-close">' + c.closeTemplate + '</div><div class="jGrowl-header">' + c.header + '</div><div class="jGrowl-message">' + e + "</div></div>").data("jGrowl", c).addClass(c.theme).children("div.jGrowl-close").bind("click.jGrowl", function () {
                a(this).parent().trigger("jGrowl.close")
            }).parent();
            a(d).bind("mouseover.jGrowl", function () {
                a("div.jGrowl-notification", b.element).data("jGrowl.pause", !0)
            }).bind("mouseout.jGrowl", function () {
                a("div.jGrowl-notification", b.element).data("jGrowl.pause", !1)
            }).bind("jGrowl.beforeOpen", function () {
                c.beforeOpen.apply(d, [d, e, c, b.element]) != !1 && a(this).trigger("jGrowl.open")
            }).bind("jGrowl.open", function () {
                c.open.apply(d, [d, e, c, b.element]) != !1 && (c.glue == "after" ? a("div.jGrowl-notification:last", b.element).after(d) : a("div.jGrowl-notification:first", b.element).before(d), a(this).animate(c.animateOpen, c.openDuration, c.easing, function () {
                    a.browser.msie && (parseInt(a(this).css("opacity"), 10) === 1 || parseInt(a(this).css("opacity"), 10) === 0) && this.style.removeAttribute("filter");
                    if (a(this).data("jGrowl") != null) a(this).data("jGrowl").created = new Date;
                    a(this).trigger("jGrowl.afterOpen")
                }))
            }).bind("jGrowl.afterOpen", function () {
                c.afterOpen.apply(d, [d, e, c, b.element])
            }).bind("jGrowl.beforeClose", function () {
                c.beforeClose.apply(d, [d, e, c, b.element]) != !1 && a(this).trigger("jGrowl.close")
            }).bind("jGrowl.close", function () {
                a(this).data("jGrowl.pause", !0);
                a(this).animate(c.animateClose, c.closeDuration, c.easing, function () {
                    a.isFunction(c.close) ? c.close.apply(d, [d, e, c, b.element]) !== !1 && a(this).remove() : a(this).remove()
                })
            }).trigger("jGrowl.beforeOpen");
            c.corners != "" && a.fn.corner != void 0 && a(d).corner(c.corners);
            a("div.jGrowl-notification:parent", b.element).size() > 1 && a("div.jGrowl-closer", b.element).size() == 0 && this.defaults.closer != !1 && a(this.defaults.closerTemplate).addClass("jGrowl-closer" + this.defaults.themeState).addClass(this.defaults.theme).appendTo(b.element).animate(this.defaults.animateOpen, this.defaults.speed, this.defaults.easing).bind("click.jGrowl", function () {
                a(this).siblings().trigger("jGrowl.beforeClose");
                a.isFunction(b.defaults.closer) && b.defaults.closer.apply(a(this).parent()[0], [a(this).parent()[0]])
            })
        },
        update: function () {
            a(this.element).find("div.jGrowl-notification:parent").each(function () {
                a(this).data("jGrowl") != void 0 && a(this).data("jGrowl").created != void 0 && a(this).data("jGrowl").created.getTime() + parseInt(a(this).data("jGrowl").life) < (new Date).getTime() && a(this).data("jGrowl").sticky != !0 && (a(this).data("jGrowl.pause") == void 0 || a(this).data("jGrowl.pause") != !0) && a(this).trigger("jGrowl.beforeClose")
            });
            this.notifications.length > 0 && (this.defaults.pool == 0 || a(this.element).find("div.jGrowl-notification:parent").size() < this.defaults.pool) && this.render(this.notifications.shift());
            a(this.element).find("div.jGrowl-notification:parent").size() < 2 && a(this.element).find("div.jGrowl-closer").animate(this.defaults.animateClose, this.defaults.speed, this.defaults.easing, function () {
                a(this).remove()
            })
        },
        startup: function (d) {
            this.element = a(d).addClass("jGrowl").append('<div class="jGrowl-notification"></div>');
            this.interval = setInterval(function () {
                a(d).data("jGrowl.instance").update()
            }, parseInt(this.defaults.check))
        },
        shutdown: function () {
            a(this.element).removeClass("jGrowl").find("div.jGrowl-notification").remove();
            clearInterval(this.interval)
        },
        close: function () {
            a(this.element).find("div.jGrowl-notification").each(function () {
                a(this).trigger("jGrowl.beforeClose")
            })
        }
    });
    a.jGrowl.defaults = a.fn.jGrowl.prototype.defaults
})(jQuery);
jQuery &&
function (d) {
    d.extend(d.fn, {
        miniColors: function (j, k) {
            var w = function (a, b) {
                    var e = m(a.val());
                    e || (e = "FFFFFF");
                    var c = p(e),
                        e = d('<a class="miniColors-trigger" style="background-color: #' + e + '" href="#"></a>');
                    e.insertAfter(a);
                    a.addClass("miniColors").attr("maxlength", 7).attr("autocomplete", "off");
                    a.data("trigger", e);
                    a.data("hsb", c);
                    b.change && a.data("change", b.change);
                    b.readonly && a.attr("readonly", !0);
                    b.disabled && q(a);
                    e.bind("click.miniColors", function (b) {
                        b.preventDefault();
                        a.trigger("focus")
                    });
                    a.bind("focus.miniColors", function () {
                        v(a)
                    });
                    a.bind("blur.miniColors", function () {
                        var b = m(a.val());
                        a.val(b ? "#" + b : "")
                    });
                    a.bind("keydown.miniColors", function (b) {
                        b.keyCode === 9 && i(a)
                    });
                    a.bind("keyup.miniColors", function () {
                        var b = a.val().replace(/[^A-F0-9#]/ig, "");
                        a.val(b);
                        if (b = m(a.val())) {
                            var b = p(b),
                                c = a.data("hsb");
                            b.h === c.h && b.s === c.s && b.b === c.b || (c = r(b), d(a.data("colorPicker")).css("top", c.y + "px").css("left", c.x + "px"), c = s(b), d(a.data("huePicker")).css("top", c.y + "px"), n(a, b, !1));
                            b = !0
                        } else b = !1;
                        b || a.data("trigger").css("backgroundColor", "#FFF")
                    });
                    a.bind("paste.miniColors", function () {
                        setTimeout(function () {
                            a.trigger("keyup")
                        }, 5)
                    })
                },
                q = function (a) {
                    i(a);
                    a.attr("disabled", !0);
                    a.data("trigger").css("opacity", 0.5)
                },
                v = function (a) {
                    if (a.attr("disabled")) return !1;
                    i();
                    var b = d('<div class="miniColors-selector"></div>');
                    b.append('<div class="miniColors-colors" style="background-color: #FFF;"><div class="miniColors-colorPicker"></div></div>');
                    b.append('<div class="miniColors-hues"><div class="miniColors-huePicker"></div></div>');
                    b.css({
                        top: a.is(":visible") ? a.offset().top + a.outerHeight() : a.data("trigger").offset().top + a.data("trigger").outerHeight(),
                        left: a.is(":visible") ? a.offset().left : a.data("trigger").offset().left,
                        display: "none"
                    }).addClass(a.attr("class"));
                    var e = a.data("hsb");
                    b.find(".miniColors-colors").css("backgroundColor", "#" + o(l({
                        h: e.h,
                        s: 100,
                        b: 100
                    })));
                    var c = a.data("colorPosition");
                    c || (c = r(e));
                    b.find(".miniColors-colorPicker").css("top", c.y + "px").css("left", c.x + "px");
                    (c = a.data("huePosition")) || (c = s(e));
                    b.find(".miniColors-huePicker").css("top", c.y + "px");
                    a.data("selector", b);
                    a.data("huePicker", b.find(".miniColors-huePicker"));
                    a.data("colorPicker", b.find(".miniColors-colorPicker"));
                    a.data("mousebutton", 0);
                    d("BODY").append(b);
                    b.fadeIn(100);
                    b.bind("selectstart", function () {
                        return !1
                    });
                    d(document).bind("mousedown.miniColors", function (b) {
                        a.data("mousebutton", 1);
                        d(b.target).parents().andSelf().hasClass("miniColors-colors") && (b.preventDefault(), a.data("moving", "colors"), t(a, b));
                        d(b.target).parents().andSelf().hasClass("miniColors-hues") && (b.preventDefault(), a.data("moving", "hues"), u(a, b));
                        d(b.target).parents().andSelf().hasClass("miniColors-selector") ? b.preventDefault() : d(b.target).parents().andSelf().hasClass("miniColors") || i(a)
                    });
                    d(document).bind("mouseup.miniColors", function () {
                        a.data("mousebutton", 0);
                        a.removeData("moving")
                    });
                    d(document).bind("mousemove.miniColors", function (b) {
                        a.data("mousebutton") === 1 && (a.data("moving") === "colors" && t(a, b), a.data("moving") === "hues" && u(a, b))
                    })
                },
                i = function (a) {
                    a || (a = ".miniColors");
                    d(a).each(function () {
                        var a = d(this).data("selector");
                        d(this).removeData("selector");
                        d(a).fadeOut(100, function () {
                            d(this).remove()
                        })
                    });
                    d(document).unbind("mousedown.miniColors");
                    d(document).unbind("mousemove.miniColors")
                },
                t = function (a, b) {
                    var e = a.data("colorPicker");
                    e.hide();
                    var c = {
                        x: b.clientX - a.data("selector").find(".miniColors-colors").offset().left + d(document).scrollLeft() - 5,
                        y: b.clientY - a.data("selector").find(".miniColors-colors").offset().top + d(document).scrollTop() - 5
                    };
                    if (c.x <= -5) c.x = -5;
                    if (c.x >= 144) c.x = 144;
                    if (c.y <= -5) c.y = -5;
                    if (c.y >= 144) c.y = 144;
                    a.data("colorPosition", c);
                    e.css("left", c.x).css("top", c.y).show();
                    e = Math.round((c.x + 5) * 0.67);
                    e < 0 && (e = 0);
                    e > 100 && (e = 100);
                    c = 100 - Math.round((c.y + 5) * 0.67);
                    c < 0 && (c = 0);
                    c > 100 && (c = 100);
                    var g = a.data("hsb");
                    g.s = e;
                    g.b = c;
                    n(a, g, !0)
                },
                u = function (a, b) {
                    var e = a.data("huePicker");
                    e.hide();
                    var c = {
                        y: b.clientY - a.data("selector").find(".miniColors-colors").offset().top + d(document).scrollTop() - 1
                    };
                    if (c.y <= -1) c.y = -1;
                    if (c.y >= 149) c.y = 149;
                    a.data("huePosition", c);
                    e.css("top", c.y).show();
                    e = Math.round((150 - c.y - 1) * 2.4);
                    e < 0 && (e = 0);
                    e > 360 && (e = 360);
                    c = a.data("hsb");
                    c.h = e;
                    n(a, c, !0)
                },
                n = function (a, b, e) {
                    a.data("hsb", b);
                    var c = o(l(b));
                    e && a.val("#" + c);
                    a.data("trigger").css("backgroundColor", "#" + c);
                    a.data("selector") && a.data("selector").find(".miniColors-colors").css("backgroundColor", "#" + o(l({
                        h: b.h,
                        s: 100,
                        b: 100
                    })));
                    a.data("change") && a.data("change").call(a, "#" + c, l(b))
                },
                r = function (a) {
                    var b = Math.ceil(a.s / 0.67);
                    b < 0 && (b = 0);
                    b > 150 && (b = 150);
                    a = 150 - Math.ceil(a.b / 0.67);
                    a < 0 && (a = 0);
                    a > 150 && (a = 150);
                    return {
                        x: b - 5,
                        y: a - 5
                    }
                },
                s = function (a) {
                    a = 150 - a.h / 2.4;
                    a < 0 && (h = 0);
                    a > 150 && (h = 150);
                    return {
                        y: a - 1
                    }
                },
                m = function (a) {
                    a = a.replace(/[^A-Fa-f0-9]/, "");
                    a.length == 3 && (a = a[0] + a[0] + a[1] + a[1] + a[2] + a[2]);
                    return a.length === 6 ? a : null
                },
                l = function (a) {
                    var b, e, c;
                    b = Math.round(a.h);
                    var d = Math.round(a.s * 255 / 100),
                        a = Math.round(a.b * 255 / 100);
                    if (d == 0) b = e = c = a;
                    else {
                        var d = (255 - d) * a / 255,
                            f = (a - d) * (b % 60) / 60;
                        b == 360 && (b = 0);
                        b < 60 ? (b = a, c = d, e = d + f) : b < 120 ? (e = a, c = d, b = a - f) : b < 180 ? (e = a, b = d, c = d + f) : b < 240 ? (c = a, b = d, e = a - f) : b < 300 ? (c = a, e = d, b = d + f) : b < 360 ? (b = a, e = d, c = a - f) : c = e = b = 0
                    }
                    return {
                        r: Math.round(b),
                        g: Math.round(e),
                        b: Math.round(c)
                    }
                },
                o = function (a) {
                    var b = [a.r.toString(16), a.g.toString(16), a.b.toString(16)];
                    d.each(b, function (a, c) {
                        c.length == 1 && (b[a] = "0" + c)
                    });
                    return b.join("")
                },
                p = function (a) {
                    var b = a,
                        b = parseInt(b.indexOf("#") > -1 ? b.substring(1) : b, 16),
                        a = b >> 16,
                        d = (b & 65280) >> 8;
                    b &= 255;
                    var c = {
                        h: 0,
                        s: 0,
                        b: 0
                    },
                        g = Math.min(a, d, b),
                        f = Math.max(a, d, b),
                        g = f - g;
                    c.b = f;
                    c.s = f != 0 ? 255 * g / f : 0;
                    c.h = c.s != 0 ? a == f ? (d - b) / g : d == f ? 2 + (b - a) / g : 4 + (a - d) / g : -1;
                    c.h *= 60;
                    c.h < 0 && (c.h += 360);
                    c.s *= 100 / 255;
                    c.b *= 100 / 255;
                    if (c.s === 0) c.h = 360;
                    return c
                };
            switch (j) {
            case "readonly":
                return d(this).each(function () {
                    d(this).attr("readonly", k)
                }), d(this);
            case "disabled":
                return d(this).each(function () {
                    if (k) q(d(this));
                    else {
                        var a = d(this);
                        a.attr("disabled", !1);
                        a.data("trigger").css("opacity", 1)
                    }
                }), d(this);
            case "value":
                return d(this).each(function () {
                    d(this).val(k).trigger("keyup")
                }), d(this);
            case "destroy":
                return d(this).each(function () {
                    var a = d(this);
                    i();
                    a = d(a);
                    a.data("trigger").remove();
                    a.removeAttr("autocomplete");
                    a.removeData("trigger");
                    a.removeData("selector");
                    a.removeData("hsb");
                    a.removeData("huePicker");
                    a.removeData("colorPicker");
                    a.removeData("mousebutton");
                    a.removeData("moving");
                    a.unbind("click.miniColors");
                    a.unbind("focus.miniColors");
                    a.unbind("blur.miniColors");
                    a.unbind("keyup.miniColors");
                    a.unbind("keydown.miniColors");
                    a.unbind("paste.miniColors");
                    d(document).unbind("mousedown.miniColors");
                    d(document).unbind("mousemove.miniColors")
                }), d(this);
            default:
                return j || (j = {}), d(this).each(function () {
                    d(this)[0].tagName.toLowerCase() === "input" && (d(this).data("trigger") || w(d(this), j, k))
                }), d(this)
            }
        }
    })
}(jQuery);
(function (h, d, a) {
    function i(b) {
        var c = {},
            d = /^jQuery\d+$/;
        a.each(b.attributes, function (b, a) {
            if (a.specified && !d.test(a.name)) c[a.name] = a.value
        });
        return c
    }
    function f() {
        var b = a(this);
        b.val() === b.attr("placeholder") && b.hasClass("placeholder") && (b.data("placeholder-password") ? b.hide().next().show().focus().attr("id", b.removeAttr("id").data("placeholder-id")) : b.val("").removeClass("placeholder"))
    }
    function g() {
        var b, c = a(this),
            d = this.id;
        if (c.val() === "") {
            if (c.is(":password")) {
                if (!c.data("placeholder-textinput")) {
                    try {
                        b = c.clone().attr({
                            type: "text"
                        })
                    } catch (e) {
                        b = a("<input>").attr(a.extend(i(this), {
                            type: "text"
                        }))
                    }
                    b.removeAttr("name").data("placeholder-password", !0).data("placeholder-id", d).bind("focus.placeholder", f);
                    c.data("placeholder-textinput", b).data("placeholder-id", d).before(b)
                }
                c = c.removeAttr("id").hide().prev().attr("id", d).show()
            }
            c.addClass("placeholder").val(c.attr("placeholder"))
        } else c.removeClass("placeholder")
    }
    var e = "placeholder" in d.createElement("input"),
        d = "placeholder" in d.createElement("textarea");
    e && d ? (a.fn.placeholder = function () {
        return this
    }, a.fn.placeholder.input = a.fn.placeholder.textarea = !0) : (a.fn.placeholder = function () {
        return this.filter((e ? "textarea" : ":input") + "[placeholder]").bind("focus.placeholder", f).bind("blur.placeholder", g).trigger("blur.placeholder").end()
    }, a.fn.placeholder.input = e, a.fn.placeholder.textarea = d, a(function () {
        a("form").bind("submit.placeholder", function () {
            var b = a(".placeholder", this).each(f);
            setTimeout(function () {
                b.each(g)
            }, 10)
        })
    }), a(h).bind("unload.placeholder", function () {
        a(".placeholder").val("")
    }))
})(this, document, jQuery);
(function (a) {
    function t() {
        url = location.href;
        return hashtag = url.indexOf("#!") != -1 ? decodeURI(url.substring(url.indexOf("#!") + 2, url.length)) : !1
    }
    function g(a, g) {
        var a = a.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"),
            k = RegExp("[\\?&]" + a + "=([^&#]*)").exec(g);
        return k == null ? "" : k[1]
    }
    a.prettyPhoto = {
        version: "3.1.3"
    };
    a.fn.prettyPhoto = function (j) {
        function n() {
            a(".pp_loaderIcon").hide();
            projectedTop = scroll_pos.scrollTop + (d / 2 - b.containerHeight / 2);
            projectedTop < 0 && (projectedTop = 0);
            $ppt.fadeTo(settings.animation_speed, 1);
            $pp_pic_holder.find(".pp_content").animate({
                height: b.contentHeight,
                width: b.contentWidth
            }, settings.animation_speed);
            $pp_pic_holder.animate({
                top: projectedTop,
                left: e / 2 - b.containerWidth / 2,
                width: b.containerWidth
            }, settings.animation_speed, function () {
                $pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(b.height).width(b.width);
                $pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed);
                isSet && o(pp_images[set_position]) == "image" ? $pp_pic_holder.find(".pp_hoverContainer").show() : $pp_pic_holder.find(".pp_hoverContainer").hide();
                b.resized ? a("a.pp_expand,a.pp_contract").show() : a("a.pp_expand").hide();
                settings.autoplay_slideshow && !l && !p && a.prettyPhoto.startSlideshow();
                settings.changepicturecallback();
                p = !0
            });
            isSet && settings.overlay_gallery && o(pp_images[set_position]) == "image" && settings.ie6_fallback && !(a.browser.msie && parseInt(a.browser.version) == 6) ? (itemWidth = 57, navWidth = settings.theme == "facebook" || settings.theme == "pp_default" ? 50 : 30, itemsPerPage = Math.floor((b.containerWidth - 100 - navWidth) / itemWidth), itemsPerPage = itemsPerPage < pp_images.length ? itemsPerPage : pp_images.length, totalPage = Math.ceil(pp_images.length / itemsPerPage) - 1, totalPage == 0 ? (navWidth = 0, $pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").hide()) : $pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").show(), galleryWidth = itemsPerPage * itemWidth, fullGalleryWidth = pp_images.length * itemWidth, $pp_gallery.css("margin-left", -(galleryWidth / 2 + navWidth / 2)).find("div:first").width(galleryWidth + 5).find("ul").width(fullGalleryWidth).find("li.selected").removeClass("selected"), goToPage = Math.floor(set_position / itemsPerPage) < totalPage ? Math.floor(set_position / itemsPerPage) : totalPage, a.prettyPhoto.changeGalleryPage(goToPage), $pp_gallery_li.filter(":eq(" + set_position + ")").addClass("selected")) : $pp_pic_holder.find(".pp_content").unbind("mouseenter mouseleave")
        }
        function k(c) {
            $pp_pic_holder.find("#pp_full_res object,#pp_full_res embed").css("visibility", "hidden");
            $pp_pic_holder.find(".pp_fade").fadeOut(settings.animation_speed, function () {
                a(".pp_loaderIcon").show();
                c()
            })
        }
        function y(c) {
            c > 1 ? a(".pp_nav").show() : a(".pp_nav").hide()
        }
        function f(a, b) {
            resized = !1;
            u(a, b);
            imageWidth = a;
            imageHeight = b;
            if ((h > e || i > d) && doresize && settings.allow_resize && !m) {
                for (resized = !0, fitting = !1; !fitting;) h > e ? (imageWidth = e - 200, imageHeight = b / a * imageWidth) : i > d ? (imageHeight = d - 200, imageWidth = a / b * imageHeight) : fitting = !0, i = imageHeight, h = imageWidth;
                u(imageWidth, imageHeight);
                (h > e || i > d) && f(h, i)
            }
            return {
                width: Math.floor(imageWidth),
                height: Math.floor(imageHeight),
                containerHeight: Math.floor(i),
                containerWidth: Math.floor(h) + settings.horizontal_padding * 2,
                contentHeight: Math.floor(q),
                contentWidth: Math.floor(v),
                resized: resized
            }
        }
        function u(c, b) {
            c = parseFloat(c);
            b = parseFloat(b);
            $pp_details = $pp_pic_holder.find(".pp_details");
            $pp_details.width(c);
            detailsHeight = parseFloat($pp_details.css("marginTop")) + parseFloat($pp_details.css("marginBottom"));
            $pp_details = $pp_details.clone().addClass(settings.theme).width(c).appendTo(a("body")).css({
                position: "absolute",
                top: -1E4
            });
            detailsHeight += $pp_details.height();
            detailsHeight = detailsHeight <= 34 ? 36 : detailsHeight;
            a.browser.msie && a.browser.version == 7 && (detailsHeight += 8);
            $pp_details.remove();
            $pp_title = $pp_pic_holder.find(".ppt");
            $pp_title.width(c);
            titleHeight = parseFloat($pp_title.css("marginTop")) + parseFloat($pp_title.css("marginBottom"));
            $pp_title = $pp_title.clone().appendTo(a("body")).css({
                position: "absolute",
                top: -1E4
            });
            titleHeight += $pp_title.height();
            $pp_title.remove();
            q = b + detailsHeight;
            v = c;
            i = q + titleHeight + $pp_pic_holder.find(".pp_top").height() + $pp_pic_holder.find(".pp_bottom").height();
            h = c
        }
        function o(a) {
            return a.match(/youtube\.com\/watch/i) || a.match(/youtu\.be/i) ? "youtube" : a.match(/vimeo\.com/i) ? "vimeo" : a.match(/\b.mov\b/i) ? "quicktime" : a.match(/\b.swf\b/i) ? "flash" : a.match(/\biframe=true\b/i) ? "iframe" : a.match(/\bajax=true\b/i) ? "ajax" : a.match(/\bcustom=true\b/i) ? "custom" : a.substr(0, 1) == "#" ? "inline" : "image"
        }
        function r() {
            doresize && typeof $pp_pic_holder != "undefined" && (scroll_pos = w(), contentHeight = $pp_pic_holder.height(), contentwidth = $pp_pic_holder.width(), projectedTop = d / 2 + scroll_pos.scrollTop - contentHeight / 2, projectedTop < 0 && (projectedTop = 0), contentHeight > d || $pp_pic_holder.css({
                top: projectedTop,
                left: e / 2 + scroll_pos.scrollLeft - contentwidth / 2
            }))
        }
        function w() {
            if (self.pageYOffset) return {
                scrollTop: self.pageYOffset,
                scrollLeft: self.pageXOffset
            };
            else if (document.documentElement && document.documentElement.scrollTop) return {
                scrollTop: document.documentElement.scrollTop,
                scrollLeft: document.documentElement.scrollLeft
            };
            else if (document.body) return {
                scrollTop: document.body.scrollTop,
                scrollLeft: document.body.scrollLeft
            }
        }

        function x() {
            settings.social_tools && (facebook_like_link = settings.social_tools.replace("{location_href}", encodeURIComponent(location.href)));
            settings.markup = settings.markup.replace("{pp_social}", settings.social_tools ? facebook_like_link : "");
            a("body").append(settings.markup);
            $pp_pic_holder = a(".pp_pic_holder");
            $ppt = a(".ppt");
            $pp_overlay = a("div.pp_overlay");
            if (isSet && settings.overlay_gallery) {
                currentGalleryPage = 0;
                toInject = "";
                for (var c = 0; c < pp_images.length; c++) pp_images[c].match(/\b(jpg|jpeg|png|gif)\b/gi) ? (classname = "", img_src = pp_images[c]) : (classname = "default", img_src = ""), toInject += "<li class='" + classname + "'><a href='#'><img src='" + img_src + "' width='50' alt='' /></a></li>";
                toInject = settings.gallery_markup.replace(/{gallery}/g, toInject);
                $pp_pic_holder.find("#pp_full_res").after(toInject);
                $pp_gallery = a(".pp_pic_holder .pp_gallery");
                $pp_gallery_li = $pp_gallery.find("li");
                $pp_gallery.find(".pp_arrow_next").click(function () {
                    a.prettyPhoto.changeGalleryPage("next");
                    a.prettyPhoto.stopSlideshow();
                    return !1
                });
                $pp_gallery.find(".pp_arrow_previous").click(function () {
                    a.prettyPhoto.changeGalleryPage("previous");
                    a.prettyPhoto.stopSlideshow();
                    return !1
                });
                $pp_pic_holder.find(".pp_content").hover(function () {
                    $pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeIn()
                }, function () {
                    $pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeOut()
                });
                itemWidth = 57;
                $pp_gallery_li.each(function (c) {
                    a(this).find("a").click(function () {
                        a.prettyPhoto.changePage(c);
                        a.prettyPhoto.stopSlideshow();
                        return !1
                    })
                })
            }
            settings.slideshow && ($pp_pic_holder.find(".pp_nav").prepend('<a href="#" class="pp_play">Play</a>'), $pp_pic_holder.find(".pp_nav .pp_play").click(function () {
                a.prettyPhoto.startSlideshow();
                return !1
            }));
            $pp_pic_holder.attr("class", "pp_pic_holder " + settings.theme);
            $pp_overlay.css({
                opacity: 0,
                height: a(document).height(),
                width: a(window).width()
            }).bind("click", function () {
                settings.modal || a.prettyPhoto.close()
            });
            a("a.pp_close").bind("click", function () {
                a.prettyPhoto.close();
                return !1
            });
            a("a.pp_expand").bind("click", function () {
                a(this).hasClass("pp_expand") ? (a(this).removeClass("pp_expand").addClass("pp_contract"), doresize = !1) : (a(this).removeClass("pp_contract").addClass("pp_expand"), doresize = !0);
                k(function () {
                    a.prettyPhoto.open()
                });
                return !1
            });
            $pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click", function () {
                a.prettyPhoto.changePage("previous");
                a.prettyPhoto.stopSlideshow();
                return !1
            });
            $pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click", function () {
                a.prettyPhoto.changePage("next");
                a.prettyPhoto.stopSlideshow();
                return !1
            });
            r()
        }
        var j = jQuery.extend({
            animation_speed: "fast",
            slideshow: 5E3,
            autoplay_slideshow: !1,
            opacity: 0.8,
            show_title: !0,
            allow_resize: !0,
            default_width: 500,
            default_height: 344,
            counter_separator_label: "/",
            theme: "pp_default",
            horizontal_padding: 20,
            hideflash: !1,
            wmode: "opaque",
            autoplay: !0,
            modal: !1,
            deeplinking: !0,
            overlay_gallery: !0,
            keyboard_shortcuts: !0,
            changepicturecallback: function () {},
            callback: function () {},
            ie6_fallback: !0,
            markup: '<div class="pp_pic_holder"> \t\t\t\t\t\t<div class="ppt">&nbsp;</div> \t\t\t\t\t\t<div class="pp_top"> \t\t\t\t\t\t\t<div class="pp_left"></div> \t\t\t\t\t\t\t<div class="pp_middle"></div> \t\t\t\t\t\t\t<div class="pp_right"></div> \t\t\t\t\t\t</div> \t\t\t\t\t\t<div class="pp_content_container"> \t\t\t\t\t\t\t<div class="pp_left"> \t\t\t\t\t\t\t<div class="pp_right"> \t\t\t\t\t\t\t\t<div class="pp_content"> \t\t\t\t\t\t\t\t\t<div class="pp_loaderIcon"></div> \t\t\t\t\t\t\t\t\t<div class="pp_fade"> \t\t\t\t\t\t\t\t\t\t<a href="#" class="pp_expand" title="Expand the image">Expand</a> \t\t\t\t\t\t\t\t\t\t<div class="pp_hoverContainer"> \t\t\t\t\t\t\t\t\t\t\t<a class="pp_next" href="#">next</a> \t\t\t\t\t\t\t\t\t\t\t<a class="pp_previous" href="#">previous</a> \t\t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t\t\t<div id="pp_full_res"></div> \t\t\t\t\t\t\t\t\t\t<div class="pp_details"> \t\t\t\t\t\t\t\t\t\t\t<div class="pp_nav"> \t\t\t\t\t\t\t\t\t\t\t\t<a href="#" class="pp_arrow_previous">Previous</a> \t\t\t\t\t\t\t\t\t\t\t\t<p class="currentTextHolder">0/0</p> \t\t\t\t\t\t\t\t\t\t\t\t<a href="#" class="pp_arrow_next">Next</a> \t\t\t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t\t\t\t<p class="pp_description"></p> \t\t\t\t\t\t\t\t\t\t\t<div class="pp_social">{pp_social}</div> \t\t\t\t\t\t\t\t\t\t\t<a class="pp_close" href="#">Close</a> \t\t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t</div> \t\t\t\t\t\t<div class="pp_bottom"> \t\t\t\t\t\t\t<div class="pp_left"></div> \t\t\t\t\t\t\t<div class="pp_middle"></div> \t\t\t\t\t\t\t<div class="pp_right"></div> \t\t\t\t\t\t</div> \t\t\t\t\t</div> \t\t\t\t\t<div class="pp_overlay"></div>',
            gallery_markup: '<div class="pp_gallery"> \t\t\t\t\t\t\t\t<a href="#" class="pp_arrow_previous">Previous</a> \t\t\t\t\t\t\t\t<div> \t\t\t\t\t\t\t\t\t<ul> \t\t\t\t\t\t\t\t\t\t{gallery} \t\t\t\t\t\t\t\t\t</ul> \t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t<a href="#" class="pp_arrow_next">Next</a> \t\t\t\t\t\t\t</div>',
            image_markup: '<img id="fullResImage" src="{path}" />',
            flash_markup: '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',
            quicktime_markup: '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',
            iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',
            inline_markup: '<div class="pp_inline">{content}</div>',
            custom_markup: "",
            social_tools: '<div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"><\/script></div><div class="facebook"><iframe src="http://www.facebook.com/plugins/like.php?locale=en_US&href={location_href}&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>'
        }, j),
            s = this,
            m = !1,
            b, p, q, v, i, h, d = a(window).height(),
            e = a(window).width(),
            l;
        doresize = !0;
        scroll_pos = w();
        a(window).unbind("resize.prettyphoto").bind("resize.prettyphoto", function () {
            r();
            d = a(window).height();
            e = a(window).width();
            typeof $pp_overlay != "undefined" && $pp_overlay.height(a(document).height()).width(e)
        });
        j.keyboard_shortcuts && a(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto", function (c) {
            if (typeof $pp_pic_holder != "undefined" && $pp_pic_holder.is(":visible")) switch (c.keyCode) {
            case 37:
                a.prettyPhoto.changePage("previous");
                c.preventDefault();
                break;
            case 39:
                a.prettyPhoto.changePage("next");
                c.preventDefault();
                break;
            case 27:
                settings.modal || a.prettyPhoto.close(), c.preventDefault()
            }
        });
        a.prettyPhoto.initialize = function () {
            settings = j;
            if (settings.theme == "pp_default") settings.horizontal_padding = 16;
            if (settings.ie6_fallback && a.browser.msie && parseInt(a.browser.version) == 6) settings.theme = "light_square";
            theRel = a(this).attr("rel");
            galleryRegExp = /\[(?:.*)\]/;
            pp_images = (isSet = galleryRegExp.exec(theRel) ? !0 : !1) ? jQuery.map(s, function (c) {
                if (a(c).attr("rel").indexOf(theRel) != -1) return a(c).attr("href")
            }) : a.makeArray(a(this).attr("href"));
            pp_titles = isSet ? jQuery.map(s, function (c) {
                if (a(c).attr("rel").indexOf(theRel) != -1) return a(c).find("img").attr("alt") ? a(c).find("img").attr("alt") : ""
            }) : a.makeArray(a(this).find("img").attr("alt"));
            pp_descriptions = isSet ? jQuery.map(s, function (c) {
                if (a(c).attr("rel").indexOf(theRel) != -1) return a(c).attr("title") ? a(c).attr("title") : ""
            }) : a.makeArray(a(this).attr("title"));
            if (pp_images.length > 30) settings.overlay_gallery = !1;
            set_position = jQuery.inArray(a(this).attr("href"), pp_images);
            rel_index = isSet ? set_position : a("a[rel^='" + theRel + "']").index(a(this));
            x(this);
            settings.allow_resize && a(window).bind("scroll.prettyphoto", function () {
                r()
            });
            a.prettyPhoto.open();
            return !1
        };
        a.prettyPhoto.open = function (c, d, e) {
            if (typeof settings == "undefined") {
                settings = j;
                if (a.browser.msie && a.browser.version == 6) settings.theme = "light_square";
                pp_images = a.makeArray(c);
                pp_titles = d ? a.makeArray(d) : a.makeArray("");
                pp_descriptions = e ? a.makeArray(e) : a.makeArray("");
                isSet = pp_images.length > 1 ? !0 : !1;
                set_position = 0;
                x(c.target)
            }
            a.browser.msie && a.browser.version == 6 && a("select").css("visibility", "hidden");
            settings.hideflash && a("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility", "hidden");
            y(a(pp_images).size());
            a(".pp_loaderIcon").show();
            if (settings.deeplinking && typeof theRel != "undefined") location.hash = "!" + theRel + "/" + rel_index + "/";
            settings.social_tools && (facebook_like_link = settings.social_tools.replace("{location_href}", encodeURIComponent(location.href)), $pp_pic_holder.find(".pp_social").html(facebook_like_link));
            $ppt.is(":hidden") && $ppt.css("opacity", 0).show();
            $pp_overlay.show().fadeTo(settings.animation_speed, settings.opacity);
            $pp_pic_holder.find(".currentTextHolder").text(set_position + 1 + settings.counter_separator_label + a(pp_images).size());
            pp_descriptions[set_position] != "" ? $pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position])) : $pp_pic_holder.find(".pp_description").hide();
            movie_width = parseFloat(g("width", pp_images[set_position])) ? g("width", pp_images[set_position]) : settings.default_width.toString();
            movie_height = parseFloat(g("height", pp_images[set_position])) ? g("height", pp_images[set_position]) : settings.default_height.toString();
            m = !1;
            movie_height.indexOf("%") != -1 && (movie_height = parseFloat(a(window).height() * parseFloat(movie_height) / 100 - 150), m = !0);
            movie_width.indexOf("%") != -1 && (movie_width = parseFloat(a(window).width() * parseFloat(movie_width) / 100 - 150), m = !0);
            $pp_pic_holder.fadeIn(function () {
                settings.show_title && pp_titles[set_position] != "" && typeof pp_titles[set_position] != "undefined" ? $ppt.html(unescape(pp_titles[set_position])) : $ppt.html("&nbsp;");
                imgPreloader = "";
                skipInjection = !1;
                switch (o(pp_images[set_position])) {
                case "image":
                    imgPreloader = new Image;
                    nextImage = new Image;
                    if (isSet && set_position < a(pp_images).size() - 1) nextImage.src = pp_images[set_position + 1];
                    prevImage = new Image;
                    if (isSet && pp_images[set_position - 1]) prevImage.src = pp_images[set_position - 1];
                    $pp_pic_holder.find("#pp_full_res")[0].innerHTML = settings.image_markup.replace(/{path}/g, pp_images[set_position]);
                    imgPreloader.onload = function () {
                        b = f(imgPreloader.width, imgPreloader.height);
                        n()
                    };
                    imgPreloader.onerror = function () {
                        alert("Image cannot be loaded. Make sure the path is correct and image exist.");
                        a.prettyPhoto.close()
                    };
                    imgPreloader.src = pp_images[set_position];
                    break;
                case "youtube":
                    b = f(movie_width, movie_height);
                    movie_id = g("v", pp_images[set_position]);
                    movie_id == "" && (movie_id = pp_images[set_position].split("youtu.be/"), movie_id = movie_id[1], movie_id.indexOf("?") > 0 && (movie_id = movie_id.substr(0, movie_id.indexOf("?"))), movie_id.indexOf("&") > 0 && (movie_id = movie_id.substr(0, movie_id.indexOf("&"))));
                    movie = "http://www.youtube.com/embed/" + movie_id;
                    g("rel", pp_images[set_position]) ? movie += "?rel=" + g("rel", pp_images[set_position]) : movie += "?rel=1";
                    settings.autoplay && (movie += "&autoplay=1");
                    toInject = settings.iframe_markup.replace(/{width}/g, b.width).replace(/{height}/g, b.height).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, movie);
                    break;
                case "vimeo":
                    b = f(movie_width, movie_height);
                    movie_id = pp_images[set_position];
                    movie = "http://player.vimeo.com/video/" + movie_id.match(/http:\/\/(www\.)?vimeo.com\/(\d+)/)[2] + "?title=0&amp;byline=0&amp;portrait=0";
                    settings.autoplay && (movie += "&autoplay=1;");
                    vimeo_width = b.width + "/embed/?moog_width=" + b.width;
                    toInject = settings.iframe_markup.replace(/{width}/g, vimeo_width).replace(/{height}/g, b.height).replace(/{path}/g, movie);
                    break;
                case "quicktime":
                    b = f(movie_width, movie_height);
                    b.height += 15;
                    b.contentHeight += 15;
                    b.containerHeight += 15;
                    toInject = settings.quicktime_markup.replace(/{width}/g, b.width).replace(/{height}/g, b.height).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, pp_images[set_position]).replace(/{autoplay}/g, settings.autoplay);
                    break;
                case "flash":
                    b = f(movie_width, movie_height);
                    flash_vars = pp_images[set_position];
                    flash_vars = flash_vars.substring(pp_images[set_position].indexOf("flashvars") + 10, pp_images[set_position].length);
                    filename = pp_images[set_position];
                    filename = filename.substring(0, filename.indexOf("?"));
                    toInject = settings.flash_markup.replace(/{width}/g, b.width).replace(/{height}/g, b.height).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, filename + "?" + flash_vars);
                    break;
                case "iframe":
                    b = f(movie_width, movie_height);
                    frame_url = pp_images[set_position];
                    frame_url = frame_url.substr(0, frame_url.indexOf("iframe") - 1);
                    toInject = settings.iframe_markup.replace(/{width}/g, b.width).replace(/{height}/g, b.height).replace(/{path}/g, frame_url);
                    break;
                case "ajax":
                    doresize = !1;
                    b = f(movie_width, movie_height);
                    skipInjection = doresize = !0;
                    a.get(pp_images[set_position], function (a) {
                        toInject = settings.inline_markup.replace(/{content}/g, a);
                        $pp_pic_holder.find("#pp_full_res")[0].innerHTML = toInject;
                        n()
                    });
                    break;
                case "custom":
                    b = f(movie_width, movie_height);
                    toInject = settings.custom_markup;
                    break;
                case "inline":
                    myClone = a(pp_images[set_position]).clone().append('<br clear="all" />').css({
                        width: settings.default_width
                    }).wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>').appendTo(a("body")).show(), doresize = !1, b = f(a(myClone).width(), a(myClone).height()), doresize = !0, a(myClone).remove(), toInject = settings.inline_markup.replace(/{content}/g, a(pp_images[set_position]).html())
                }
                if (!imgPreloader && !skipInjection) $pp_pic_holder.find("#pp_full_res")[0].innerHTML = toInject, n()
            });
            return !1
        };
        a.prettyPhoto.changePage = function (c) {
            currentGalleryPage = 0;
            c == "previous" ? (set_position--, set_position < 0 && (set_position = a(pp_images).size() - 1)) : c == "next" ? (set_position++, set_position > a(pp_images).size() - 1 && (set_position = 0)) : set_position = c;
            rel_index = set_position;
            doresize || (doresize = !0);
            a(".pp_contract").removeClass("pp_contract").addClass("pp_expand");
            k(function () {
                a.prettyPhoto.open()
            })
        };
        a.prettyPhoto.changeGalleryPage = function (a) {
            a == "next" ? (currentGalleryPage++, currentGalleryPage > totalPage && (currentGalleryPage = 0)) : a == "previous" ? (currentGalleryPage--, currentGalleryPage < 0 && (currentGalleryPage = totalPage)) : currentGalleryPage = a;
            slide_speed = a == "next" || a == "previous" ? settings.animation_speed : 0;
            slide_to = currentGalleryPage * itemsPerPage * itemWidth;
            $pp_gallery.find("ul").animate({
                left: -slide_to
            }, slide_speed)
        };
        a.prettyPhoto.startSlideshow = function () {
            typeof l == "undefined" ? ($pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function () {
                a.prettyPhoto.stopSlideshow();
                return !1
            }), l = setInterval(a.prettyPhoto.startSlideshow, settings.slideshow)) : a.prettyPhoto.changePage("next")
        };
        a.prettyPhoto.stopSlideshow = function () {
            $pp_pic_holder.find(".pp_pause").unbind("click").removeClass("pp_pause").addClass("pp_play").click(function () {
                a.prettyPhoto.startSlideshow();
                return !1
            });
            clearInterval(l);
            l = void 0
        };
        a.prettyPhoto.close = function () {
            $pp_overlay.is(":animated") || (a.prettyPhoto.stopSlideshow(), $pp_pic_holder.stop().find("object,embed").css("visibility", "hidden"), a("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed, function () {
                a(this).remove()
            }), $pp_overlay.fadeOut(settings.animation_speed, function () {
                a.browser.msie && a.browser.version == 6 && a("select").css("visibility", "visible");
                settings.hideflash && a("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility", "visible");
                a(this).remove();
                a(window).unbind("scroll.prettyphoto");
                url = location.href;
                if (hashtag = url.indexOf("#!prettyPhoto") ? !0 : !1) location.hash = "!prettyPhoto";
                settings.callback();
                doresize = !0;
                p = !1;
                delete settings
            }))
        };
        !pp_alreadyInitialized && t() && (pp_alreadyInitialized = !0, hashRel = hashIndex = t(), hashIndex = hashIndex.substring(hashIndex.indexOf("/") + 1, hashIndex.length - 1), hashRel = hashRel.substring(0, hashRel.indexOf("/")), setTimeout(function () {
            a("a[rel^='" + hashRel + "']:eq(" + hashIndex + ")").trigger("click")
        }, 50));
        return this.unbind("click.prettyphoto").bind("click.prettyphoto", a.prettyPhoto.initialize)
    }
})(jQuery);
var pp_alreadyInitialized = !1;
(function (a) {
    function j(c, e) {
        this.$element = a(c);
        this.options = e;
        this.enabled = !0;
        this.fixTitle()
    }
    j.prototype = {
        show: function () {
            var c, e, b = this.getTitle();
            if (b && this.enabled) {
                var d = this.tip();
                d.find(".tipsy-inner")[this.options.html ? "html" : "text"](b);
                d[0].className = "tipsy";
                d.remove().css({
                    top: 0,
                    left: 0,
                    visibility: "hidden",
                    display: "block"
                }).prependTo(document.body);
                var b = a.extend({}, this.$element.offset(), {
                    width: this.$element[0].offsetWidth,
                    height: this.$element[0].offsetHeight
                }),
                    h = d[0].offsetWidth,
                    f = d[0].offsetHeight,
                    g = typeof this.options.gravity == "function" ? this.options.gravity.call(this.$element[0]) : this.options.gravity,
                    i;
                switch (g.charAt(0)) {
                case "n":
                    i = {
                        top: b.top + b.height + this.options.offset,
                        left: b.left + b.width / 2 - h / 2
                    };
                    c = 15;
                    e = -h / 2;
                    break;
                case "s":
                    i = {
                        top: b.top - f - this.options.offset,
                        left: b.left + b.width / 2 - h / 2
                    };
                    c = -f - 15;
                    e = -h / 2;
                    break;
                case "e":
                    i = {
                        top: b.top + b.height / 2 - f / 2,
                        left: b.left - h - this.options.offset
                    };
                    c = -f / 2;
                    e = -12 - h;
                    break;
                case "w":
                    i = {
                        top: b.top + b.height / 2 - f / 2,
                        left: b.left + b.width + this.options.offset
                    }, c = -f / 2, e = 12
                }
                if (g.length == 2) i.left = g.charAt(1) == "w" ? b.left + b.width / 2 - 15 : b.left + b.width / 2 - h + 15;
                this.options.followMouse && a(document).bind("mousemove", function (b) {
                    d.css({
                        left: b.pageX + e,
                        top: b.pageY + c
                    })
                });
                d.css(i).addClass("tipsy-" + g);
                d.find(".tipsy-arrow")[0].className = "tipsy-arrow tipsy-arrow-" + g.charAt(0);
                this.options.className && d.addClass(typeof this.options.className == "function" ? this.options.className.call(this.$element[0]) : this.options.className);
                this.options.fade ? d.stop().css({
                    opacity: 0,
                    display: "block",
                    visibility: "visible"
                }).animate({
                    opacity: this.options.opacity
                }) : d.css({
                    visibility: "visible",
                    opacity: this.options.opacity
                })
            }
        },
        hide: function () {
            this.options.fade ? this.tip().stop().fadeOut(function () {
                a(this).remove()
            }) : this.tip().remove()
        },
        fixTitle: function () {
            var c = this.$element;
            if (c.attr("title") || typeof c.attr("original-title") != "string") c.attr("original-title", c.attr("title") || "").removeAttr("title")
        },
        getTitle: function () {
            var c, a = this.$element,
                b = this.options;
            this.fixTitle();
            b = this.options;
            typeof b.title == "string" ? c = a.attr(b.title == "title" ? "original-title" : b.title) : typeof b.title == "function" && (c = b.title.call(a[0]));
            return (c = ("" + c).replace(/(^\s*|\s*$)/, "")) || b.fallback
        },
        setTitle: function (c) {
            this.options.fallback = c
        },
        tip: function () {
            if (!this.$tip) this.$tip = a('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>');
            return this.$tip
        },
        validate: function () {
            if (!this.$element[0].parentNode) this.hide(), this.options = this.$element = null
        },
        enable: function () {
            this.enabled = !0
        },
        disable: function () {
            this.enabled = !1
        },
        toggleEnabled: function () {
            this.enabled = !this.enabled
        }
    };
    a.fn.tipsy = function (c, e) {
        function b(b) {
            var d = a.data(b, "tipsy");
            d || (d = new j(b, a.fn.tipsy.elementOptions(b, c)), a.data(b, "tipsy", d));
            return d
        }
        function d() {
            var a = b(this);
            a.hoverState = "in";
            c.delayIn == 0 ? a.show() : (a.fixTitle(), setTimeout(function () {
                a.hoverState == "in" && a.show()
            }, c.delayIn))
        }
        function h() {
            var a = b(this);
            a.hoverState = "out";
            c.delayOut == 0 ? a.hide() : setTimeout(function () {
                a.hoverState == "out" && a.hide()
            }, c.delayOut)
        }
        if (c === !0) return this.data("tipsy");
        else if (typeof c == "string") {
            var f = this.data("tipsy");
            if (f) f[c](e);
            return this
        }
        c = a.extend({}, a.fn.tipsy.defaults, c);
        c.live || this.each(function () {
            b(this)
        });
        if (c.trigger != "manual") {
            var f = c.live ? "live" : "bind",
                g = c.trigger == "hover" ? "mouseleave" : "blur";
            this[f](c.trigger == "hover" ? "mouseenter" : "focus", d)[f](g, h)
        }
        return this
    };
    a.fn.tipsy.defaults = {
        className: null,
        delayIn: 0,
        delayOut: 0,
        fade: !1,
        fallback: "",
        gravity: "n",
        html: !1,
        live: !1,
        offset: 0,
        opacity: 0.8,
        title: "title",
        trigger: "hover"
    };
    a.fn.tipsy.elementOptions = function (c, e) {
        return a.metadata ? a.extend({}, e, a(c).metadata()) : e
    };
    a.fn.tipsy.autoNS = function () {
        return a(this).offset().top > a(document).scrollTop() + a(window).height() / 2 ? "s" : "n"
    };
    a.fn.tipsy.autoWE = function () {
        return a(this).offset().left > a(document).scrollLeft() + a(window).width() / 2 ? "e" : "w"
    };
    a.fn.tipsy.autoBounds = function (c, e) {
        return function () {
            var b = e[0],
                d = e.length > 1 ? e[1] : !1,
                h = a(document).scrollTop() + c,
                f = a(document).scrollLeft() + c,
                g = a(this);
            g.offset().top < h && (b = "n");
            g.offset().left < f && (d = "w");
            a(window).width() + a(document).scrollLeft() - g.offset().left < c && (d = "e");
            a(window).height() + a(document).scrollTop() - g.offset().top < c && (b = "s");
            return b + (d ? d : "")
        }
    }
})(jQuery);
(function (c) {
    function e(a) {
        var b = a.originalEvent.changedTouches[0];
        return c.extend(a, {
            type: f[a.type],
            which: 1,
            pageX: b.pageX,
            pageY: b.pageY,
            screenX: b.screenX,
            screenY: b.screenY,
            clientX: b.clientX,
            clientY: b.clientY
        })
    }
    c.support.touch = typeof Touch === "object";
    if (c.support.touch) {
        var d = c.ui.mouse.prototype,
            g = d._mouseInit,
            h = d._mouseDown,
            i = d._mouseUp,
            f = {
                touchstart: "mousedown",
                touchmove: "mousemove",
                touchend: "mouseup"
            };
        d._mouseInit = function () {
            var a = this;
            a.element.bind("touchstart." + a.widgetName, function (b) {
                return a._mouseDown(e(b))
            });
            g.call(a)
        };
        d._mouseDown = function (a) {
            var b = this,
                a = h.call(b, a);
            b._touchMoveDelegate = function (a) {
                return b._mouseMove(e(a))
            };
            b._touchEndDelegate = function (a) {
                return b._mouseUp(e(a))
            };
            c(document).bind("touchmove." + b.widgetName, b._touchMoveDelegate).bind("touchend." + b.widgetName, b._touchEndDelegate);
            return a
        };
        d._mouseUp = function (a) {
            c(document).unbind("touchmove." + this.widgetName, this._touchMoveDelegate).unbind("touchend." + this.widgetName, this._touchEndDelegate);
            return i.call(this, a)
        }
    }
})(jQuery);
(function (c) {
    c.extend(c.fn, {
        validate: function (a) {
            if (this.length) {
                var b = c.data(this[0], "validator");
                if (b) return b;
                this.attr("novalidate", "novalidate");
                b = new c.validator(a, this[0]);
                c.data(this[0], "validator", b);
                b.settings.onsubmit && (a = this.find("input, button"), a.filter(".cancel").click(function () {
                    b.cancelSubmit = !0
                }), b.settings.submitHandler && a.filter(":submit").click(function () {
                    b.submitButton = this
                }), this.submit(function (a) {
                    function e() {
                        if (b.settings.submitHandler) {
                            if (b.submitButton) var a = c("<input type='hidden'/>").attr("name", b.submitButton.name).val(b.submitButton.value).appendTo(b.currentForm);
                            b.settings.submitHandler.call(b, b.currentForm);
                            b.submitButton && a.remove();
                            return !1
                        }
                        return !0
                    }
                    b.settings.debug && a.preventDefault();
                    return b.cancelSubmit ? (b.cancelSubmit = !1, e()) : b.form() ? b.pendingRequest ? (b.formSubmitted = !0, !1) : e() : (b.focusInvalid(), !1)
                }));
                return b
            } else a && a.debug && window.console && console.warn("nothing selected, can't validate, returning nothing")
        },
        valid: function () {
            if (c(this[0]).is("form")) return this.validate().form();
            else {
                var a = !0,
                    b = c(this[0].form).validate();
                this.each(function () {
                    a &= b.element(this)
                });
                return a
            }
        },
        removeAttrs: function (a) {
            var b = {},
                d = this;
            c.each(a.split(/\s/), function (a, c) {
                b[c] = d.attr(c);
                d.removeAttr(c)
            });
            return b
        },
        rules: function (a, b) {
            var d = this[0];
            if (a) {
                var e = c.data(d.form, "validator").settings,
                    f = e.rules,
                    g = c.validator.staticRules(d);
                switch (a) {
                case "add":
                    c.extend(g, c.validator.normalizeRule(b));
                    f[d.name] = g;
                    b.messages && (e.messages[d.name] = c.extend(e.messages[d.name], b.messages));
                    break;
                case "remove":
                    if (!b) return delete f[d.name], g;
                    var h = {};
                    c.each(b.split(/\s/), function (a, b) {
                        h[b] = g[b];
                        delete g[b]
                    });
                    return h
                }
            }
            d = c.validator.normalizeRules(c.extend({}, c.validator.metadataRules(d), c.validator.classRules(d), c.validator.attributeRules(d), c.validator.staticRules(d)), d);
            if (d.required) e = d.required, delete d.required, d = c.extend({
                required: e
            }, d);
            return d
        }
    });
    c.extend(c.expr[":"], {
        blank: function (a) {
            return !c.trim("" + a.value)
        },
        filled: function (a) {
            return !!c.trim("" + a.value)
        },
        unchecked: function (a) {
            return !a.checked
        }
    });
    c.validator = function (a, b) {
        this.settings = c.extend(!0, {}, c.validator.defaults, a);
        this.currentForm = b;
        this.init()
    };
    c.validator.format = function (a, b) {
        if (arguments.length == 1) return function () {
            var b = c.makeArray(arguments);
            b.unshift(a);
            return c.validator.format.apply(this, b)
        };
        arguments.length > 2 && b.constructor != Array && (b = c.makeArray(arguments).slice(1));
        b.constructor != Array && (b = [b]);
        c.each(b, function (b, c) {
            a = a.replace(RegExp("\\{" + b + "\\}", "g"), c)
        });
        return a
    };
    c.extend(c.validator, {
        defaults: {
            messages: {},
            groups: {},
            rules: {},
            errorClass: "error",
            validClass: "valid",
            errorElement: "label",
            focusInvalid: !0,
            errorContainer: c([]),
            errorLabelContainer: c([]),
            onsubmit: !0,
            ignore: ":hidden",
            ignoreTitle: !1,
            onfocusin: function (a) {
                this.lastActive = a;
                this.settings.focusCleanup && !this.blockFocusCleanup && (this.settings.unhighlight && this.settings.unhighlight.call(this, a, this.settings.errorClass, this.settings.validClass), this.addWrapper(this.errorsFor(a)).hide())
            },
            onfocusout: function (a) {
                !this.checkable(a) && (a.name in this.submitted || !this.optional(a)) && this.element(a)
            },
            onkeyup: function (a) {
                (a.name in this.submitted || a == this.lastElement) && this.element(a)
            },
            onclick: function (a) {
                a.name in this.submitted ? this.element(a) : a.parentNode.name in this.submitted && this.element(a.parentNode)
            },
            highlight: function (a, b, d) {
                a.type === "radio" ? this.findByName(a.name).addClass(b).removeClass(d) : c(a).addClass(b).removeClass(d)
            },
            unhighlight: function (a, b, d) {
                a.type === "radio" ? this.findByName(a.name).removeClass(b).addClass(d) : c(a).removeClass(b).addClass(d)
            }
        },
        setDefaults: function (a) {
            c.extend(c.validator.defaults, a)
        },
        messages: {
            required: "Wajib diisi.",
            remote: "Tolong perbaiki field ini.",
            email: "Tolong isi dengan alamat email yang benar.",
            url: "Tolong isi dengan URL benar.",
            date: "Tolong isi dengan tanggal yang benar.",
            dateISO: "Tolong isi dengan tanggal yang benar. (YYYY-MM-DD).",
            number: "Tolong isi dengan angka.",
            digits: "Tolong isi dengan angka digit.",
            creditcard: "Tolong isi dengan nomor kartu credit yang benar.",
            equalTo: "Please enter the same value again.",
            accept: "Please enter a value with a valid extension.",
            maxlength: c.validator.format("Maaf, karakter maksimal {0}."),
            minlength: c.validator.format("Tolong isi dengan minimal {0} karakter."),
            rangelength: c.validator.format("Tolong isi dengan banyak karakter diantara {0} dan {1}"),
            range: c.validator.format("Please enter a value between {0} and {1}."),
            max: c.validator.format("Please enter a value less than or equal to {0}."),
            min: c.validator.format("Please enter a value greater than or equal to {0}.")
        },
        autoCreateRanges: !1,
        prototype: {
            init: function () {
                function a(a) {
                    var b = c.data(this[0].form, "validator"),
                        d = "on" + a.type.replace(/^validate/, "");
                    b.settings[d] && b.settings[d].call(b, this[0], a)
                }
                this.labelContainer = c(this.settings.errorLabelContainer);
                this.errorContext = this.labelContainer.length && this.labelContainer || c(this.currentForm);
                this.containers = c(this.settings.errorContainer).add(this.settings.errorLabelContainer);
                this.submitted = {};
                this.valueCache = {};
                this.pendingRequest = 0;
                this.pending = {};
                this.invalid = {};
                this.reset();
                var b = this.groups = {};
                c.each(this.settings.groups, function (a, d) {
                    c.each(d.split(/\s/), function (c, d) {
                        b[d] = a
                    })
                });
                var d = this.settings.rules;
                c.each(d, function (a, b) {
                    d[a] = c.validator.normalizeRule(b)
                });
                c(this.currentForm).validateDelegate("[type='text'], [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ", "focusin focusout keyup", a).validateDelegate("[type='radio'], [type='checkbox'], select, option", "click", a);
                this.settings.invalidHandler && c(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler)
            },
            form: function () {
                this.checkForm();
                c.extend(this.submitted, this.errorMap);
                this.invalid = c.extend({}, this.errorMap);
                this.valid() || c(this.currentForm).triggerHandler("invalid-form", [this]);
                this.showErrors();
                return this.valid()
            },
            checkForm: function () {
                this.prepareForm();
                for (var a = 0, b = this.currentElements = this.elements(); b[a]; a++) this.check(b[a]);
                return this.valid()
            },
            element: function (a) {
                this.lastElement = a = this.validationTargetFor(this.clean(a));
                this.prepareElement(a);
                this.currentElements = c(a);
                var b = this.check(a);
                b ? delete this.invalid[a.name] : this.invalid[a.name] = !0;
                if (!this.numberOfInvalids()) this.toHide = this.toHide.add(this.containers);
                this.showErrors();
                return b
            },
            showErrors: function (a) {
                if (a) {
                    c.extend(this.errorMap, a);
                    this.errorList = [];
                    for (var b in a) this.errorList.push({
                        message: a[b],
                        element: this.findByName(b)[0]
                    });
                    this.successList = c.grep(this.successList, function (b) {
                        return !(b.name in a)
                    })
                }
                this.settings.showErrors ? this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors()
            },
            resetForm: function () {
                c.fn.resetForm && c(this.currentForm).resetForm();
                this.submitted = {};
                this.lastElement = null;
                this.prepareForm();
                this.hideErrors();
                this.elements().removeClass(this.settings.errorClass)
            },
            numberOfInvalids: function () {
                return this.objectLength(this.invalid)
            },
            objectLength: function (a) {
                var b = 0,
                    c;
                for (c in a) b++;
                return b
            },
            hideErrors: function () {
                this.addWrapper(this.toHide).hide()
            },
            valid: function () {
                return this.size() == 0
            },
            size: function () {
                return this.errorList.length
            },
            focusInvalid: function () {
                if (this.settings.focusInvalid) try {
                    c(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible").focus().trigger("focusin")
                } catch (a) {}
            },
            findLastActive: function () {
                var a = this.lastActive;
                return a && c.grep(this.errorList, function (b) {
                    return b.element.name == a.name
                }).length == 1 && a
            },
            elements: function () {
                var a = this,
                    b = {};
                return c(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function () {
                    !this.name && a.settings.debug && window.console && console.error("%o has no name assigned", this);
                    return this.name in b || !a.objectLength(c(this).rules()) ? !1 : b[this.name] = !0
                })
            },
            clean: function (a) {
                return c(a)[0]
            },
            errors: function () {
                return c(this.settings.errorElement + "." + this.settings.errorClass, this.errorContext)
            },
            reset: function () {
                this.successList = [];
                this.errorList = [];
                this.errorMap = {};
                this.toShow = c([]);
                this.toHide = c([]);
                this.currentElements = c([])
            },
            prepareForm: function () {
                this.reset();
                this.toHide = this.errors().add(this.containers)
            },
            prepareElement: function (a) {
                this.reset();
                this.toHide = this.errorsFor(a)
            },
            check: function (a) {
                var a = this.validationTargetFor(this.clean(a)),
                    b = c(a).rules(),
                    d = !1,
                    e;
                for (e in b) {
                    var f = {
                        method: e,
                        parameters: b[e]
                    };
                    try {
                        var g = c.validator.methods[e].call(this, a.value.replace(/\r/g, ""), a, f.parameters);
                        if (g == "dependency-mismatch") d = !0;
                        else {
                            d = !1;
                            if (g == "pending") {
                                this.toHide = this.toHide.not(this.errorsFor(a));
                                return
                            }
                            if (!g) return this.formatAndAdd(a, f), !1
                        }
                    } catch (h) {
                        throw this.settings.debug && window.console && console.log("exception occured when checking element " + a.id + ", check the '" + f.method + "' method", h), h;
                    }
                }
                if (!d) return this.objectLength(b) && this.successList.push(a), !0
            },
            customMetaMessage: function (a, b) {
                if (c.metadata) {
                    var d = this.settings.meta ? c(a).metadata()[this.settings.meta] : c(a).metadata();
                    return d && d.messages && d.messages[b]
                }
            },
            customMessage: function (a, b) {
                var c = this.settings.messages[a];
                return c && (c.constructor == String ? c : c[b])
            },
            findDefined: function () {
                for (var a = 0; a < arguments.length; a++) if (arguments[a] !== void 0) return arguments[a]
            },
            defaultMessage: function (a, b) {
                return this.findDefined(this.customMessage(a.name, b), this.customMetaMessage(a, b), !this.settings.ignoreTitle && a.title || void 0, c.validator.messages[b], "<strong>Warning: No message defined for " + a.name + "</strong>")
            },
            formatAndAdd: function (a, b) {
                var c = this.defaultMessage(a, b.method),
                    e = /\$?\{(\d+)\}/g;
                typeof c == "function" ? c = c.call(this, b.parameters, a) : e.test(c) && (c = jQuery.format(c.replace(e, "{$1}"), b.parameters));
                this.errorList.push({
                    message: c,
                    element: a
                });
                this.errorMap[a.name] = c;
                this.submitted[a.name] = c
            },
            addWrapper: function (a) {
                this.settings.wrapper && (a = a.add(a.parent(this.settings.wrapper)));
                return a
            },
            defaultShowErrors: function () {
                for (var a = 0; this.errorList[a]; a++) {
                    var b = this.errorList[a];
                    this.settings.highlight && this.settings.highlight.call(this, b.element, this.settings.errorClass, this.settings.validClass);
                    this.showLabel(b.element, b.message)
                }
                if (this.errorList.length) this.toShow = this.toShow.add(this.containers);
                if (this.settings.success) for (a = 0; this.successList[a]; a++) this.showLabel(this.successList[a]);
                if (this.settings.unhighlight) {
                    a = 0;
                    for (b = this.validElements(); b[a]; a++) this.settings.unhighlight.call(this, b[a], this.settings.errorClass, this.settings.validClass)
                }
                this.toHide = this.toHide.not(this.toShow);
                this.hideErrors();
                this.addWrapper(this.toShow).show()
            },
            validElements: function () {
                return this.currentElements.not(this.invalidElements())
            },
            invalidElements: function () {
                return c(this.errorList).map(function () {
                    return this.element
                })
            },
            showLabel: function (a, b) {
                var d = this.errorsFor(a);
                d.length ? (d.removeClass(this.settings.validClass).addClass(this.settings.errorClass), d.attr("generated") && d.html(b)) : (d = c("<" + this.settings.errorElement + "/>").attr({
                    "for": this.idOrName(a),
                    generated: !0
                }).addClass(this.settings.errorClass).html(b || ""), this.settings.wrapper && (d = d.hide().show().wrap("<" + this.settings.wrapper + "/>").parent()), this.labelContainer.append(d).length || (this.settings.errorPlacement ? this.settings.errorPlacement(d, c(a)) : d.insertAfter(a)));
                !b && this.settings.success && (d.text(""), typeof this.settings.success == "string" ? d.addClass(this.settings.success) : this.settings.success(d));
                this.toShow = this.toShow.add(d)
            },
            errorsFor: function (a) {
                var b = this.idOrName(a);
                return this.errors().filter(function () {
                    return c(this).attr("for") == b
                })
            },
            idOrName: function (a) {
                return this.groups[a.name] || (this.checkable(a) ? a.name : a.id || a.name)
            },
            validationTargetFor: function (a) {
                this.checkable(a) && (a = this.findByName(a.name).not(this.settings.ignore)[0]);
                return a
            },
            checkable: function (a) {
                return /radio|checkbox/i.test(a.type)
            },
            findByName: function (a) {
                var b = this.currentForm;
                return c(document.getElementsByName(a)).map(function (c, e) {
                    return e.form == b && e.name == a && e || null
                })
            },
            getLength: function (a, b) {
                switch (b.nodeName.toLowerCase()) {
                case "select":
                    return c("option:selected", b).length;
                case "input":
                    if (this.checkable(b)) return this.findByName(b.name).filter(":checked").length
                }
                return a.length
            },
            depend: function (a, b) {
                return this.dependTypes[typeof a] ? this.dependTypes[typeof a](a, b) : !0
            },
            dependTypes: {
                "boolean": function (a) {
                    return a
                },
                string: function (a, b) {
                    return !!c(a, b.form).length
                },
                "function": function (a, b) {
                    return a(b)
                }
            },
            optional: function (a) {
                return !c.validator.methods.required.call(this, c.trim(a.value), a) && "dependency-mismatch"
            },
            startRequest: function (a) {
                this.pending[a.name] || (this.pendingRequest++, this.pending[a.name] = !0)
            },
            stopRequest: function (a, b) {
                this.pendingRequest--;
                if (this.pendingRequest < 0) this.pendingRequest = 0;
                delete this.pending[a.name];
                if (b && this.pendingRequest == 0 && this.formSubmitted && this.form()) c(this.currentForm).submit(), this.formSubmitted = !1;
                else if (!b && this.pendingRequest == 0 && this.formSubmitted) c(this.currentForm).triggerHandler("invalid-form", [this]), this.formSubmitted = !1
            },
            previousValue: function (a) {
                return c.data(a, "previousValue") || c.data(a, "previousValue", {
                    old: null,
                    valid: !0,
                    message: this.defaultMessage(a, "remote")
                })
            }
        },
        classRuleSettings: {
            required: {
                required: !0
            },
            email: {
                email: !0
            },
            url: {
                url: !0
            },
            date: {
                date: !0
            },
            dateISO: {
                dateISO: !0
            },
            dateDE: {
                dateDE: !0
            },
            number: {
                number: !0
            },
            numberDE: {
                numberDE: !0
            },
            digits: {
                digits: !0
            },
            creditcard: {
                creditcard: !0
            }
        },
        addClassRules: function (a, b) {
            a.constructor == String ? this.classRuleSettings[a] = b : c.extend(this.classRuleSettings, a)
        },
        classRules: function (a) {
            var b = {};
            (a = c(a).attr("class")) && c.each(a.split(" "), function () {
                this in c.validator.classRuleSettings && c.extend(b, c.validator.classRuleSettings[this])
            });
            return b
        },
        attributeRules: function (a) {
            var b = {},
                a = c(a),
                d;
            for (d in c.validator.methods) {
                var e;
                (e = d === "required" && typeof c.fn.prop === "function" ? a.prop(d) : a.attr(d)) ? b[d] = e : a[0].getAttribute("type") === d && (b[d] = !0)
            }
            b.maxlength && /-1|2147483647|524288/.test(b.maxlength) && delete b.maxlength;
            return b
        },
        metadataRules: function (a) {
            if (!c.metadata) return {};
            var b = c.data(a.form, "validator").settings.meta;
            return b ? c(a).metadata()[b] : c(a).metadata()
        },
        staticRules: function (a) {
            var b = {},
                d = c.data(a.form, "validator");
            d.settings.rules && (b = c.validator.normalizeRule(d.settings.rules[a.name]) || {});
            return b
        },
        normalizeRules: function (a, b) {
            c.each(a, function (d, e) {
                if (e === !1) delete a[d];
                else if (e.param || e.depends) {
                    var f = !0;
                    switch (typeof e.depends) {
                    case "string":
                        f = !! c(e.depends, b.form).length;
                        break;
                    case "function":
                        f = e.depends.call(b, b)
                    }
                    f ? a[d] = e.param !== void 0 ? e.param : !0 : delete a[d]
                }
            });
            c.each(a, function (d, e) {
                a[d] = c.isFunction(e) ? e(b) : e
            });
            c.each(["minlength", "maxlength", "min", "max"], function () {
                a[this] && (a[this] = Number(a[this]))
            });
            c.each(["rangelength", "range"], function () {
                a[this] && (a[this] = [Number(a[this][0]), Number(a[this][1])])
            });
            if (c.validator.autoCreateRanges) {
                if (a.min && a.max) a.range = [a.min, a.max], delete a.min, delete a.max;
                if (a.minlength && a.maxlength) a.rangelength = [a.minlength, a.maxlength], delete a.minlength, delete a.maxlength
            }
            a.messages && delete a.messages;
            return a
        },
        normalizeRule: function (a) {
            if (typeof a == "string") {
                var b = {};
                c.each(a.split(/\s/), function () {
                    b[this] = !0
                });
                a = b
            }
            return a
        },
        addMethod: function (a, b, d) {
            c.validator.methods[a] = b;
            c.validator.messages[a] = d != void 0 ? d : c.validator.messages[a];
            b.length < 3 && c.validator.addClassRules(a, c.validator.normalizeRule(a))
        },
        methods: {
            required: function (a, b, d) {
                if (!this.depend(d, b)) return "dependency-mismatch";
                switch (b.nodeName.toLowerCase()) {
                case "select":
                    return (a = c(b).val()) && a.length > 0;
                case "input":
                    if (this.checkable(b)) return this.getLength(a, b) > 0;
                default:
                    return c.trim(a).length > 0
                }
            },
            remote: function (a, b, d) {
                if (this.optional(b)) return "dependency-mismatch";
                var e = this.previousValue(b);
                this.settings.messages[b.name] || (this.settings.messages[b.name] = {});
                e.originalMessage = this.settings.messages[b.name].remote;
                this.settings.messages[b.name].remote = e.message;
                d = typeof d == "string" && {
                    url: d
                } || d;
                if (this.pending[b.name]) return "pending";
                if (e.old === a) return e.valid;
                e.old = a;
                var f = this;
                this.startRequest(b);
                var g = {};
                g[b.name] = a;
                c.ajax(c.extend(!0, {
                    url: d,
                    mode: "abort",
                    port: "validate" + b.name,
                    dataType: "json",
                    data: g,
                    success: function (d) {
                        f.settings.messages[b.name].remote = e.originalMessage;
                        var g = d === !0;
                        if (g) {
                            var i = f.formSubmitted;
                            f.prepareElement(b);
                            f.formSubmitted = i;
                            f.successList.push(b);
                            f.showErrors()
                        } else i = {}, d = d || f.defaultMessage(b, "remote"), i[b.name] = e.message = c.isFunction(d) ? d(a) : d, f.showErrors(i);
                        e.valid = g;
                        f.stopRequest(b, g)
                    }
                }, d));
                return "pending"
            },
            minlength: function (a, b, d) {
                return this.optional(b) || this.getLength(c.trim(a), b) >= d
            },
            maxlength: function (a, b, d) {
                return this.optional(b) || this.getLength(c.trim(a), b) <= d
            },
            rangelength: function (a, b, d) {
                a = this.getLength(c.trim(a), b);
                return this.optional(b) || a >= d[0] && a <= d[1]
            },
            min: function (a, b, c) {
                return this.optional(b) || a >= c
            },
            max: function (a, b, c) {
                return this.optional(b) || a <= c
            },
            range: function (a, b, c) {
                return this.optional(b) || a >= c[0] && a <= c[1]
            },
            email: function (a, b) {
                return this.optional(b) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(a)
            },
            url: function (a, b) {
                return this.optional(b) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)
            },
            date: function (a, b) {
                return this.optional(b) || !/Invalid|NaN/.test(new Date(a))
            },
            dateISO: function (a, b) {
                return this.optional(b) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(a)
            },
            number: function (a, b) {
                return this.optional(b) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(a)
            },
            digits: function (a, b) {
                return this.optional(b) || /^\d+$/.test(a)
            },
            creditcard: function (a, b) {
                if (this.optional(b)) return "dependency-mismatch";
                if (/[^0-9 -]+/.test(a)) return !1;
                for (var c = 0, e = 0, f = !1, a = a.replace(/\D/g, ""), g = a.length - 1; g >= 0; g--) {
                    e = a.charAt(g);
                    e = parseInt(e, 10);
                    if (f && (e *= 2) > 9) e -= 9;
                    c += e;
                    f = !f
                }
                return c % 10 == 0
            },
            accept: function (a, b, c) {
                c = typeof c == "string" ? c.replace(/,/g, "|") : "png|jpe?g|gif";
                return this.optional(b) || a.match(RegExp(".(" + c + ")$", "i"))
            },
            equalTo: function (a, b, d) {
                d = c(d).unbind(".validate-equalTo").bind("blur.validate-equalTo", function () {
                    c(b).valid()
                });
                return a == d.val()
            }
        }
    });
    c.format = c.validator.format
})(jQuery);
(function (c) {
    var a = {};
    if (c.ajaxPrefilter) c.ajaxPrefilter(function (b, c, f) {
        c = b.port;
        b.mode == "abort" && (a[c] && a[c].abort(), a[c] = f)
    });
    else {
        var b = c.ajax;
        c.ajax = function (d) {
            var e = ("port" in d ? d : c.ajaxSettings).port;
            return ("mode" in d ? d : c.ajaxSettings).mode == "abort" ? (a[e] && a[e].abort(), a[e] = b.apply(this, arguments)) : b.apply(this, arguments)
        }
    }
})(jQuery);
(function (c) {
    !jQuery.event.special.focusin && !jQuery.event.special.focusout && document.addEventListener && c.each({
        focus: "focusin",
        blur: "focusout"
    }, function (a, b) {
        function d(a) {
            a = c.event.fix(a);
            a.type = b;
            return c.event.handle.call(this, a)
        }
        c.event.special[b] = {
            setup: function () {
                this.addEventListener(a, d, !0)
            },
            teardown: function () {
                this.removeEventListener(a, d, !0)
            },
            handler: function (a) {
                arguments[0] = c.event.fix(a);
                arguments[0].type = b;
                return c.event.handle.apply(this, arguments)
            }
        }
    });
    c.extend(c.fn, {
        validateDelegate: function (a, b, d) {
            return this.bind(b, function (b) {
                var f = c(b.target);
                if (f.is(a)) return d.apply(f, arguments)
            })
        }
    })
})(jQuery);
(function (b) {
    function j() {
        this.controls = {
            bold: {
                groupIndex: 0,
                visible: !0,
                tags: ["b", "strong"],
                css: {
                    fontWeight: "bold"
                },
                tooltip: "Bold",
                hotkey: {
                    ctrl: 1,
                    key: 66
                }
            },
            copy: {
                groupIndex: 8,
                visible: !1,
                tooltip: "Copy"
            },
            createLink: {
                groupIndex: 6,
                visible: !0,
                exec: function () {
                    var a = this;
                    b.wysiwyg.controls && b.wysiwyg.controls.link ? b.wysiwyg.controls.link.init(this) : b.wysiwyg.autoload ? b.wysiwyg.autoload.control("wysiwyg.link.js", function () {
                        a.controls.createLink.exec.apply(a)
                    }) : h.error("$.wysiwyg.controls.link not defined. You need to include wysiwyg.link.js file")
                },
                tags: ["a"],
                tooltip: "Create link"
            },
            cut: {
                groupIndex: 8,
                visible: !1,
                tooltip: "Cut"
            },
            decreaseFontSize: {
                groupIndex: 9,
                visible: !1,
                tags: ["small"],
                tooltip: "Decrease font size",
                exec: function () {
                    this.decreaseFontSize()
                }
            },
            h1: {
                groupIndex: 7,
                visible: !0,
                className: "h1",
                command: b.browser.msie || b.browser.safari ? "FormatBlock" : "heading",
                arguments: b.browser.msie || b.browser.safari ? "<h1>" : "h1",
                tags: ["h1"],
                tooltip: "Header 1"
            },
            h2: {
                groupIndex: 7,
                visible: !0,
                className: "h2",
                command: b.browser.msie || b.browser.safari ? "FormatBlock" : "heading",
                arguments: b.browser.msie || b.browser.safari ? "<h2>" : "h2",
                tags: ["h2"],
                tooltip: "Header 2"
            },
            h3: {
                groupIndex: 7,
                visible: !0,
                className: "h3",
                command: b.browser.msie || b.browser.safari ? "FormatBlock" : "heading",
                arguments: b.browser.msie || b.browser.safari ? "<h3>" : "h3",
                tags: ["h3"],
                tooltip: "Header 3"
            },
            highlight: {
                tooltip: "Highlight",
                className: "highlight",
                groupIndex: 1,
                visible: !1,
                css: {
                    backgroundColor: "rgb(255, 255, 102)"
                },
                exec: function () {
                    var a, c;
                    a = b.browser.msie || b.browser.safari ? "backcolor" : "hilitecolor";
                    if (b.browser.msie) c = this.getInternalRange().parentElement();
                    else {
                        c = this.getInternalSelection();
                        for (c = c.extentNode || c.focusNode; c.style === void 0;) if (c = c.parentNode, c.tagName && c.tagName.toLowerCase() === "body") return
                    }
                    this.editorDoc.execCommand(a, !1, c.style.backgroundColor === "rgb(255, 255, 102)" || c.style.backgroundColor === "#ffff66" ? "#ffffff" : "#ffff66")
                }
            },
            html: {
                groupIndex: 10,
                visible: !1,
                exec: function () {
                    var a;
                    this.options.resizeOptions && b.fn.resizable && (a = this.element.height());
                    this.viewHTML ? (this.setContent(this.original.value), b(this.original).hide(), this.editor.show(), this.options.resizeOptions && b.fn.resizable && (a === this.element.height() && this.element.height(a + this.editor.height()), this.element.resizable(b.extend(!0, {
                        alsoResize: this.editor
                    }, this.options.resizeOptions))), this.ui.toolbar.find("li").each(function () {
                        var a = b(this);
                        a.hasClass("html") ? a.removeClass("active") : a.removeClass("disabled")
                    })) : (this.saveContent(), b(this.original).css({
                        width: this.element.outerWidth() - 6,
                        height: this.element.height() - this.ui.toolbar.height() - 6,
                        resize: "none"
                    }).show(), this.editor.hide(), this.options.resizeOptions && b.fn.resizable && (a === this.element.height() && this.element.height(this.ui.toolbar.height()), this.element.resizable("destroy")), this.ui.toolbar.find("li").each(function () {
                        var a = b(this);
                        a.hasClass("html") ? a.addClass("active") : !1 === a.hasClass("fullscreen") && a.removeClass("active").addClass("disabled")
                    }));
                    this.viewHTML = !this.viewHTML
                },
                tooltip: "View source code"
            },
            increaseFontSize: {
                groupIndex: 9,
                visible: !1,
                tags: ["big"],
                tooltip: "Increase font size",
                exec: function () {
                    this.increaseFontSize()
                }
            },
            indent: {
                groupIndex: 2,
                visible: !0,
                tooltip: "Indent"
            },
            insertHorizontalRule: {
                groupIndex: 6,
                visible: !0,
                tags: ["hr"],
                tooltip: "Insert Horizontal Rule"
            },
            insertImage: {
                groupIndex: 6,
                visible: !0,
                exec: function () {
                    var a = this;
                    b.wysiwyg.controls && b.wysiwyg.controls.image ? b.wysiwyg.controls.image.init(this) : b.wysiwyg.autoload ? b.wysiwyg.autoload.control("wysiwyg.image.js", function () {
                        a.controls.insertImage.exec.apply(a)
                    }) : h.error("$.wysiwyg.controls.image not defined. You need to include wysiwyg.image.js file")
                },
                tags: ["img"],
                tooltip: "Insert image"
            },
            insertOrderedList: {
                groupIndex: 5,
                visible: !0,
                tags: ["ol"],
                tooltip: "Insert Ordered List"
            },
            insertTable: {
                groupIndex: 6,
                visible: !0,
                exec: function () {
                    var a = this;
                    b.wysiwyg.controls && b.wysiwyg.controls.table ? b.wysiwyg.controls.table(this) : b.wysiwyg.autoload ? b.wysiwyg.autoload.control("wysiwyg.table.js", function () {
                        a.controls.insertTable.exec.apply(a)
                    }) : h.error("$.wysiwyg.controls.table not defined. You need to include wysiwyg.table.js file")
                },
                tags: ["table"],
                tooltip: "Insert table"
            },
            insertUnorderedList: {
                groupIndex: 5,
                visible: !0,
                tags: ["ul"],
                tooltip: "Insert Unordered List"
            },
            italic: {
                groupIndex: 0,
                visible: !0,
                tags: ["i", "em"],
                css: {
                    fontStyle: "italic"
                },
                tooltip: "Italic",
                hotkey: {
                    ctrl: 1,
                    key: 73
                }
            },
            justifyCenter: {
                groupIndex: 1,
                visible: !0,
                tags: ["center"],
                css: {
                    textAlign: "center"
                },
                tooltip: "Justify Center"
            },
            justifyFull: {
                groupIndex: 1,
                visible: !0,
                css: {
                    textAlign: "justify"
                },
                tooltip: "Justify Full"
            },
            justifyLeft: {
                visible: !0,
                groupIndex: 1,
                css: {
                    textAlign: "left"
                },
                tooltip: "Justify Left"
            },
            justifyRight: {
                groupIndex: 1,
                visible: !0,
                css: {
                    textAlign: "right"
                },
                tooltip: "Justify Right"
            },
            ltr: {
                groupIndex: 10,
                visible: !1,
                exec: function () {
                    var a = this.dom.getElement("p");
                    if (!a) return !1;
                    b(a).attr("dir", "ltr");
                    return !0
                },
                tooltip: "Left to Right"
            },
            outdent: {
                groupIndex: 2,
                visible: !0,
                tooltip: "Outdent"
            },
            paragraph: {
                groupIndex: 7,
                visible: !1,
                className: "paragraph",
                command: "FormatBlock",
                arguments: b.browser.msie || b.browser.safari ? "<p>" : "p",
                tags: ["p"],
                tooltip: "Paragraph"
            },
            paste: {
                groupIndex: 8,
                visible: !1,
                tooltip: "Paste"
            },
            redo: {
                groupIndex: 4,
                visible: !0,
                tooltip: "Redo"
            },
            removeFormat: {
                groupIndex: 10,
                visible: !0,
                exec: function () {
                    this.removeFormat()
                },
                tooltip: "Remove formatting"
            },
            rtl: {
                groupIndex: 10,
                visible: !1,
                exec: function () {
                    var a = this.dom.getElement("p");
                    if (!a) return !1;
                    b(a).attr("dir", "rtl");
                    return !0
                },
                tooltip: "Right to Left"
            },
            strikeThrough: {
                groupIndex: 0,
                visible: !0,
                tags: ["s", "strike"],
                css: {
                    textDecoration: "line-through"
                },
                tooltip: "Strike-through"
            },
            subscript: {
                groupIndex: 3,
                visible: !0,
                tags: ["sub"],
                tooltip: "Subscript"
            },
            superscript: {
                groupIndex: 3,
                visible: !0,
                tags: ["sup"],
                tooltip: "Superscript"
            },
            underline: {
                groupIndex: 0,
                visible: !0,
                tags: ["u"],
                css: {
                    textDecoration: "underline"
                },
                tooltip: "Underline",
                hotkey: {
                    ctrl: 1,
                    key: 85
                }
            },
            undo: {
                groupIndex: 4,
                visible: !0,
                tooltip: "Undo"
            },
            code: {
                visible: !0,
                groupIndex: 6,
                tooltip: "Code snippet",
                exec: function () {
                    var a = this.getInternalRange(),
                        c = b(a.commonAncestorContainer),
                        a = a.commonAncestorContainer.nodeName.toLowerCase();
                    c.parent("code").length ? c.unwrap() : a !== "body" && c.wrap("<code/>")
                }
            },
            cssWrap: {
                visible: !1,
                groupIndex: 6,
                tooltip: "CSS Wrapper",
                exec: function () {
                    b.wysiwyg.controls.cssWrap.init(this)
                }
            }
        };
        this.defaults = {
            html: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" style="margin: -3px 0pt 0pt; padding: 0pt 10px; overflow-y: auto;"><head><link href="css/typographics.css" media="all" rel="stylesheet" type="text/css"><link href="css/h5bp/normalize.css" media="all" rel="stylesheet" type="text/css"><meta charset="UTF-8"></head><body style="margin:0;">INITIAL_CONTENT</body></html>',
            debug: !1,
            controls: {},
            css: "css/typographics.css",
            events: {},
            autoGrow: !1,
            autoSave: !0,
            brIE: !0,
            formHeight: 270,
            formWidth: 440,
            iFrameClass: null,
            initialContent: "<p>Initial content</p>",
            maxHeight: 1E4,
            maxLength: 0,
            messages: {
                nonSelection: "Select the text you wish to link"
            },
            toolbarHtml: '<ul role="menu" class="toolbar"></ul>',
            removeHeadings: !1,
            replaceDivWithP: !1,
            resizeOptions: !1,
            rmUnusedControls: !1,
            rmUnwantedBr: !0,
            tableFiller: "Lorem ipsum",
            initialMinHeight: null,
            controlImage: {
                forceRelativeUrls: !1
            },
            controlLink: {
                forceRelativeUrls: !1
            },
            plugins: {
                autoload: !1,
                i18n: !1,
                rmFormat: {
                    rmMsWordMarkup: !1
                }
            },
            dialog: "default"
        };
        this.availableControlProperties = "arguments,callback,className,command,css,custom,exec,groupIndex,hotkey,icon,tags,tooltip,visible".split(",");
        this.element = this.editorDoc = this.editor = null;
        this.options = {};
        this.savedRange = this.original = null;
        this.timers = [];
        this.validKeyCodes = [8, 9, 13, 16, 17, 18, 19, 20, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46];
        this.isDestroyed = !1;
        this.dom = {
            ie: {
                parent: null
            },
            w3c: {
                parent: null
            }
        };
        this.dom.parent = this;
        this.dom.ie.parent = this.dom;
        this.dom.w3c.parent = this.dom;
        this.ui = {};
        this.ui.self = this;
        this.ui.toolbar = null;
        this.ui.initialHeight = null;
        this.dom.getAncestor = function (a, b) {
            for (b = b.toLowerCase(); a && typeof a.tagName != "undefined" && "body" !== a.tagName.toLowerCase();) {
                if (b === a.tagName.toLowerCase()) return a;
                a = a.parentNode
            }
            if (!a.tagName && (a.previousSibling || a.nextSibling)) {
                if (a.previousSibling && a.previousSibling.tagName.toLowerCase() == b) return a.previousSibling;
                if (a.nextSibling && a.nextSibling.tagName.toLowerCase() == b) return a.nextSibling
            }
            return null
        };
        this.dom.getElement = function (a) {
            a = a.toLowerCase();
            return window.getSelection ? this.w3c.getElement(a) : this.ie.getElement(a)
        };
        this.dom.ie.getElement = function (a) {
            var b = this.parent,
                d = b.parent.getInternalSelection(),
                e = d.createRange();
            if ("Control" === d.type) if (1 === e.length) d = e.item(0);
            else return null;
            else d = e.parentElement();
            return b.getAncestor(d, a)
        };
        this.dom.w3c.getElement = function (a) {
            var b = this.parent,
                d = b.parent.getInternalRange(),
                e;
            if (!d) return null;
            e = d.commonAncestorContainer;
            if (3 === e.nodeType) e = e.parentNode;
            e === d.startContainer && (e = e.childNodes[d.startOffset]);
            if (!e.tagName && (e.previousSibiling || e.nextSibling)) {
                if (e.previousSibiling && e.previousSibiling.tagName.toLowerCase() == a) return e.previousSibiling;
                if (e.nextSibling && e.nextSibling.tagName.toLowerCase() == a) return e.nextSibling
            }
            return b.getAncestor(e, a)
        };
        this.ui.addHoverClass = function () {
            b(this).addClass("wysiwyg-button-hover")
        };
        this.ui.appendControls = function () {
            var a = this,
                c = this.self.parseControls(),
                d = !0,
                e = [],
                f = {},
                g, i = function (b, c) {
                    if (c.groupIndex && g !== c.groupIndex) g = c.groupIndex, d = !1;
                    c.visible && (d || (a.appendItemSeparator(), d = !0), c.custom ? a.appendItemCustom(b, c) : a.appendItem(b, c))
                };
            b.each(c, function (a, b) {
                var c = "empty";
                void 0 !== b.groupIndex && (c = "" === b.groupIndex ? "empty" : b.groupIndex);
                void 0 === f[c] && (e.push(c), f[c] = {});
                f[c][a] = b
            });
            e.sort(function (a, b) {
                return "number" === typeof a && typeof a === typeof b ? a - b : (a = a.toString(), b = b.toString(), a > b ? 1 : a === b ? 0 : -1)
            });
            0 < e.length && (g = e[0]);
            for (c = 0; c < e.length; c += 1) b.each(f[e[c]], i)
        };
        this.ui.appendItem = function (a, c) {
            var d = this.self,
                e = c.className || c.command || a || "empty",
                f = c.tooltip || c.command || a || "";
            return b('<li role="menuitem" unselectable="on">' + e + "</li>").addClass(e).attr("title", f).hover(this.addHoverClass, this.removeHoverClass).click(function () {
                if (b(this).hasClass("disabled")) return !1;
                d.triggerControl.apply(d, [a, c]);
                this.blur();
                d.ui.returnRange();
                d.ui.focus();
                return !0
            }).appendTo(d.ui.toolbar)
        };
        this.ui.appendItemCustom = function (a, c) {
            var d = this.self,
                e = c.tooltip || c.command || a || "";
            c.callback && b(window).bind("trigger-" + a + ".wysiwyg", c.callback);
            return b('<li role="menuitem" unselectable="on" style="background: url(\'' + c.icon + "') no-repeat;\"></li>").addClass("custom-command-" + a).addClass("wysiwyg-custom-command").addClass(a).attr("title", e).hover(this.addHoverClass, this.removeHoverClass).click(function () {
                if (b(this).hasClass("disabled")) return !1;
                d.triggerControl.apply(d, [a, c]);
                this.blur();
                d.ui.returnRange();
                d.ui.focus();
                d.triggerControlCallback(a);
                return !0
            }).appendTo(d.ui.toolbar)
        };
        this.ui.appendItemSeparator = function () {
            var a = this.self;
            return b('<li role="separator" class="separator"></li>').appendTo(a.ui.toolbar)
        };
        this.autoSaveFunction = function () {
            this.saveContent()
        };
        this.ui.checkTargets = function (a) {
            var c = this.self;
            b.each(c.options.controls, function (d, e) {
                var f = e.className || e.command || d || "empty",
                    g, i, h, k = function (a, b) {
                        "function" === typeof b ? b(h.css(a).toString().toLowerCase(), c) && c.ui.toolbar.find("." + f).addClass("active") : h.css(a).toString().toLowerCase() === b && c.ui.toolbar.find("." + f).addClass("active")
                    };
                "fullscreen" !== f && c.ui.toolbar.find("." + f).removeClass("active");
                if (e.tags || e.options && e.options.tags) {
                    g = e.tags || e.options && e.options.tags;
                    for (i = a; i;) {
                        if (i.nodeType !== 1) break;
                        b.inArray(i.tagName.toLowerCase(), g) !== -1 && c.ui.toolbar.find("." + f).addClass("active");
                        i = i.parentNode
                    }
                }
                if (e.css || e.options && e.options.css) {
                    g = e.css || e.options && e.options.css;
                    for (h = b(a); h;) {
                        if (h[0].nodeType !== 1) break;
                        b.each(g, k);
                        h = h.parent()
                    }
                }
            })
        };
        this.ui.designMode = function () {
            var a = this.self,
                b;
            b = function (d) {
                if ("on" === a.editorDoc.designMode) a.timers.designMode && window.clearTimeout(a.timers.designMode), a.innerDocument() !== a.editorDoc && a.ui.initFrame();
                else {
                    try {
                        a.editorDoc.designMode = "on"
                    } catch (e) {}
                    d -= 1;
                    if (d > 0) a.timers.designMode = window.setTimeout(function () {
                        b(d)
                    }, 100)
                }
            };
            b(3)
        };
        this.destroy = function () {
            this.isDestroyed = !0;
            var a, c = this.element.closest("form");
            for (a = 0; a < this.timers.length; a += 1) window.clearTimeout(this.timers[a]);
            c.unbind(".wysiwyg");
            this.element.remove();
            b.removeData(this.original, "wysiwyg");
            b(this.original).show();
            return this
        };
        this.getRangeText = function () {
            var a = this.getInternalRange();
            if (a.toString) a = a.toString();
            else if (a.text) a = a.text;
            return a
        };
        this.execute = function (a, b) {
            typeof b === "undefined" && (b = null);
            this.editorDoc.execCommand(a, !1, b)
        };
        this.extendOptions = function (a) {
            var c = {};
            if ("object" === typeof a.controls) c = a.controls, delete a.controls;
            a = b.extend(!0, {}, this.defaults, a);
            a.controls = b.extend(!0, {}, c, this.controls, c);
            a.rmUnusedControls && b.each(a.controls, function (b) {
                c[b] || delete a.controls[b]
            });
            return a
        };
        this.ui.focus = function () {
            var a = this.self;
            a.editor.get(0).contentWindow.focus();
            return a
        };
        this.ui.returnRange = function () {
            var a = this.self,
                b;
            if (a.savedRange !== null) {
                if (window.getSelection) {
                    b = window.getSelection();
                    b.rangeCount > 0 && b.removeAllRanges();
                    try {
                        b.addRange(a.savedRange)
                    } catch (d) {
                        h.error(d)
                    }
                } else window.document.createRange ? window.getSelection().addRange(a.savedRange) : window.document.selection && a.savedRange.select();
                a.savedRange = null
            }
        };
        this.increaseFontSize = function () {
            if (b.browser.mozilla || b.browser.opera) this.editorDoc.execCommand("increaseFontSize", !1, null);
            else if (b.browser.safari) {
                var a = this.getInternalRange(),
                    c = this.getInternalSelection(),
                    d = this.editorDoc.createElement("big");
                if (!0 === a.collapsed && 3 === a.commonAncestorContainer.nodeType) {
                    var e = a.commonAncestorContainer.nodeValue.toString(),
                        f = e.lastIndexOf(" ", a.startOffset) + 1,
                        e = -1 === e.indexOf(" ", a.startOffset) ? e : e.indexOf(" ", a.startOffset);
                    a.setStart(a.commonAncestorContainer, f);
                    a.setEnd(a.commonAncestorContainer, e);
                    a.surroundContents(d)
                } else a.surroundContents(d), c.removeAllRanges();
                c.addRange(a)
            } else h.error("Internet Explorer?")
        };
        this.decreaseFontSize = function () {
            if (b.browser.mozilla || b.browser.opera) this.editorDoc.execCommand("decreaseFontSize", !1, null);
            else if (b.browser.safari) {
                var a = this.getInternalRange(),
                    c = this.getInternalSelection(),
                    d = this.editorDoc.createElement("small");
                if (!0 === a.collapsed && 3 === a.commonAncestorContainer.nodeType) {
                    var e = a.commonAncestorContainer.nodeValue.toString(),
                        f = e.lastIndexOf(" ", a.startOffset) + 1,
                        e = -1 === e.indexOf(" ", a.startOffset) ? e : e.indexOf(" ", a.startOffset);
                    a.setStart(a.commonAncestorContainer, f);
                    a.setEnd(a.commonAncestorContainer, e);
                    a.surroundContents(d)
                } else a.surroundContents(d), c.removeAllRanges();
                c.addRange(a)
            } else h.error("Internet Explorer?")
        };
        this.getContent = function () {
            this.viewHTML && this.setContent(this.original.value);
            return this.events.filter("getContent", this.editorDoc.body.innerHTML)
        };
        this.events = {
            _events: {},
            bind: function (a, b) {
                typeof this._events.eventName !== "object" && (this._events[a] = []);
                this._events[a].push(b)
            },
            trigger: function (a, c) {
                if (typeof this._events.eventName === "object") {
                    var d = this.editor;
                    b.each(this._events[a], function (a, b) {
                        typeof b === "function" && b.apply(d, c)
                    })
                }
            },
            filter: function (a, c) {
                if (typeof this._events[a] === "object") {
                    var d = this.editor,
                        e = Array.prototype.slice.call(arguments, 1);
                    b.each(this._events[a], function (a, b) {
                        typeof b === "function" && (c = b.apply(d, e))
                    })
                }
                return c
            }
        };
        this.getElementByAttributeValue = function (a, c, d) {
            for (var e, f = this.editorDoc.getElementsByTagName(a), a = 0; a < f.length; a += 1) if (e = f[a].getAttribute(c), b.browser.msie && (e = e.substr(e.length - d.length)), e === d) return f[a];
            return !1
        };
        this.getInternalRange = function () {
            var a = this.getInternalSelection();
            if (!a) return null;
            if (a.rangeCount && a.rangeCount > 0) return a.getRangeAt(0);
            else if (a.createRange) return a.createRange();
            return null
        };
        this.getInternalSelection = function () {
            if (this.editor.get(0).contentWindow) {
                if (this.editor.get(0).contentWindow.getSelection) return this.editor.get(0).contentWindow.getSelection();
                if (this.editor.get(0).contentWindow.selection) return this.editor.get(0).contentWindow.selection
            }
            return this.editorDoc.getSelection ? this.editorDoc.getSelection() : this.editorDoc.selection ? this.editorDoc.selection : null
        };
        this.getRange = function () {
            var a = this.getSelection();
            if (!a) return null;
            if (a.rangeCount && a.rangeCount > 0) a.getRangeAt(0);
            else if (a.createRange) return a.createRange();
            return null
        };
        this.getSelection = function () {
            return window.getSelection ? window.getSelection() : window.document.selection
        };
        this.ui.grow = function () {
            var a = this.self,
                c = b(a.editorDoc.body),
                d = b.browser.msie ? c[0].scrollHeight : c.height() + 2 + 20,
                d = Math.max(d, a.ui.initialHeight),
                d = Math.min(d, a.options.maxHeight);
            a.editor.attr("scrolling", d < a.options.maxHeight ? "no" : "auto");
            c.css("overflow", d < a.options.maxHeight ? "hidden" : "");
            a.editor.get(0).height = d;
            return a
        };
        this.init = function (a, c) {
            var d = this,
                e = b(a).closest("form"),
                f = b(a).innerWidth() - 10,
                g = b(a).innerHeight();
            this.options = this.extendOptions(c);
            this.original = a;
            this.ui.toolbar = b(this.options.toolbarHtml);
            if (b.browser.msie && parseInt(b.browser.version, 10) < 8) this.options.autoGrow = !1;
            f === 0 && a.cols && (f = a.cols * 8 + 21);
            g === 0 && a.rows && (g = a.rows * 16 + 16);
            this.editor = b(window.location.protocol === "https:" ? '<iframe src="javascript:false;"></iframe>' : "<iframe></iframe>").attr("frameborder", "0");
            this.options.iFrameClass ? this.editor.addClass(this.options.iFrameClass) : (this.editor.css({
                minHeight: (g - 6).toString() + "px",
                width: f > 50 ? (f - 8).toString() + "px" : ""
            }), b.browser.msie && parseInt(b.browser.version, 10) < 7 && this.editor.css("height", g.toString() + "px"));
            a.id && (g = a.id + "-wysiwyg-iframe", document.getElementById(g) || this.editor.attr("id", g));
            this.editor.attr("tabindex", b(a).attr("tabindex"));
            this.element = b("<div/>").addClass("wysiwyg");
            this.options.iFrameClass || this.element.css({
                width: f > 0 ? f.toString() - 5 + "px" : "100%"
            });
            b(a).hide().before(this.element);
            this.viewHTML = !1;
            this.initialContent = b(a).val();
            this.ui.initFrame();
            this.options.resizeOptions && b.fn.resizable && this.element.resizable(b.extend(!0, {
                alsoResize: this.editor
            }, this.options.resizeOptions));
            this.options.autoSave && e.bind("submit.wysiwyg", function () {
                d.autoSaveFunction()
            });
            e.bind("reset.wysiwyg", function () {
                d.resetFunction()
            })
        };
        this.ui.initFrame = function () {
            var a = this.self,
                c;
            a.ui.appendControls();
            a.element.append(a.ui.toolbar).append(b("<div><\!-- --\></div>").css({
                clear: "both"
            })).append(a.editor);
            a.editorDoc = a.innerDocument();
            if (a.isDestroyed) return null;
            a.ui.designMode();
            a.editorDoc.open();
            a.editorDoc.write(a.options.html.replace(/INITIAL_CONTENT/, function () {
                return a.wrapInitialContent()
            }));
            a.editorDoc.close();
            b.wysiwyg.plugin.bind(a);
            b(a.editorDoc).trigger("initFrame.wysiwyg");
            b(a.editorDoc).bind("click.wysiwyg", function (b) {
                a.ui.checkTargets(b.target ? b.target : b.srcElement)
            });
            b(a.original).focus(function () {
                b(this).filter(":visible").length !== 0 && a.ui.focus()
            });
            b(a.editorDoc).keydown(function (b) {
                var c;
                return b.keyCode === 8 && (c = /^<([\w]+)[^>]*>(<br\/?>)?<\/\1>$/, c.test(a.getContent())) ? (b.stopPropagation(), !1) : !0
            });
            b.browser.msie ? a.options.brIE && b(a.editorDoc).keydown(function (b) {
                return b.keyCode === 13 ? (b = a.getRange(), b.pasteHTML("<br/>"), b.collapse(!1), b.select(), !1) : !0
            }) : b(a.editorDoc).keydown(function (b) {
                var c;
                if (b.ctrlKey || b.metaKey) for (c in a.controls) if (a.controls[c].hotkey && a.controls[c].hotkey.ctrl && b.keyCode === a.controls[c].hotkey.key) return a.triggerControl.apply(a, [c, a.controls[c]]), !1;
                return !0
            });
            a.options.plugins.rmFormat.rmMsWordMarkup && b(a.editorDoc).bind("keyup.wysiwyg", function (c) {
                if (c.ctrlKey || c.metaKey) 86 === c.keyCode && b.wysiwyg.rmFormat && ("object" === typeof a.options.plugins.rmFormat.rmMsWordMarkup ? b.wysiwyg.rmFormat.run(a, {
                    rules: {
                        msWordMarkup: a.options.plugins.rmFormat.rmMsWordMarkup
                    }
                }) : b.wysiwyg.rmFormat.run(a, {
                    rules: {
                        msWordMarkup: {
                            enabled: !0
                        }
                    }
                }))
            });
            a.options.autoSave && b(a.editorDoc).keydown(function () {
                a.autoSaveFunction()
            }).keyup(function () {
                a.autoSaveFunction()
            }).mousedown(function () {
                a.autoSaveFunction()
            }).bind(b.support.noCloneEvent ? "input.wysiwyg" : "paste.wysiwyg", function () {
                a.autoSaveFunction()
            });
            if (a.options.autoGrow) a.ui.initialHeight = a.options.initialMinHeight !== null ? a.options.initialMinHeight : b(a.editorDoc).height(), b(a.editorDoc.body).css("border", "1px solid white"), c = function () {
                a.ui.grow()
            }, b(a.editorDoc).keyup(c), b(a.editorDoc).bind("editorRefresh.wysiwyg", c), a.ui.grow();
            if (a.options.css) String === a.options.css.constructor ? b.browser.msie ? (c = a.editorDoc.createStyleSheet(a.options.css), b(c).attr({
                media: "all"
            })) : (c = b("<link/>").attr({
                href: a.options.css,
                media: "all",
                rel: "stylesheet",
                type: "text/css"
            }), b(a.editorDoc).find("head").append(c)) : a.timers.initFrame_Css = window.setTimeout(function () {
                b(a.editorDoc.body).css(a.options.css)
            }, 0);
            a.initialContent.length === 0 && ("function" === typeof a.options.initialContent ? a.setContent(a.options.initialContent()) : a.setContent(a.options.initialContent));
            a.options.maxLength > 0 && b(a.editorDoc).keydown(function (c) {
                b(a.editorDoc).text().length >= a.options.maxLength && b.inArray(c.which, a.validKeyCodes) === -1 && c.preventDefault()
            });
            b.each(a.options.events, function (c, d) {
                b(a.editorDoc).bind(c + ".wysiwyg", function (b) {
                    d.apply(a.editorDoc, [b, a])
                })
            });
            b.browser.msie ? b(a.editorDoc).bind("beforedeactivate.wysiwyg", function () {
                a.savedRange = a.getInternalRange()
            }) : b(a.editorDoc).bind("blur.wysiwyg", function () {
                a.savedRange = a.getInternalRange()
            });
            b(a.editorDoc.body).addClass("wysiwyg");
            if (a.options.events && a.options.events.save) c = a.options.events.save, b(a.editorDoc).bind("keyup.wysiwyg", c), b(a.editorDoc).bind("change.wysiwyg", c), b.support.noCloneEvent ? b(a.editorDoc).bind("input.wysiwyg", c) : (b(a.editorDoc).bind("paste.wysiwyg", c), b(a.editorDoc).bind("cut.wysiwyg", c));
            if (a.options.xhtml5 && a.options.unicode) {
                var d = {
                    ne: 8800,
                    le: 8804,
                    para: 182,
                    xi: 958,
                    darr: 8595,
                    nu: 957,
                    oacute: 243,
                    Uacute: 218,
                    omega: 969,
                    prime: 8242,
                    pound: 163,
                    igrave: 236,
                    thorn: 254,
                    forall: 8704,
                    emsp: 8195,
                    lowast: 8727,
                    brvbar: 166,
                    alefsym: 8501,
                    nbsp: 160,
                    delta: 948,
                    clubs: 9827,
                    lArr: 8656,
                    Omega: 937,
                    Auml: 196,
                    cedil: 184,
                    and: 8743,
                    plusmn: 177,
                    ge: 8805,
                    raquo: 187,
                    uml: 168,
                    equiv: 8801,
                    laquo: 171,
                    rdquo: 8221,
                    Epsilon: 917,
                    divide: 247,
                    fnof: 402,
                    chi: 967,
                    Dagger: 8225,
                    iacute: 237,
                    rceil: 8969,
                    sigma: 963,
                    Oslash: 216,
                    acute: 180,
                    frac34: 190,
                    lrm: 8206,
                    upsih: 978,
                    Scaron: 352,
                    part: 8706,
                    exist: 8707,
                    nabla: 8711,
                    image: 8465,
                    prop: 8733,
                    zwj: 8205,
                    omicron: 959,
                    aacute: 225,
                    Yuml: 376,
                    Yacute: 221,
                    weierp: 8472,
                    rsquo: 8217,
                    otimes: 8855,
                    kappa: 954,
                    thetasym: 977,
                    harr: 8596,
                    Ouml: 214,
                    Iota: 921,
                    ograve: 242,
                    sdot: 8901,
                    copy: 169,
                    oplus: 8853,
                    acirc: 226,
                    sup: 8835,
                    zeta: 950,
                    Iacute: 205,
                    Oacute: 211,
                    crarr: 8629,
                    Nu: 925,
                    bdquo: 8222,
                    lsquo: 8216,
                    apos: 39,
                    Beta: 914,
                    eacute: 233,
                    egrave: 232,
                    lceil: 8968,
                    Kappa: 922,
                    piv: 982,
                    Ccedil: 199,
                    ldquo: 8220,
                    Xi: 926,
                    cent: 162,
                    uarr: 8593,
                    hellip: 8230,
                    Aacute: 193,
                    ensp: 8194,
                    sect: 167,
                    Ugrave: 217,
                    aelig: 230,
                    ordf: 170,
                    curren: 164,
                    sbquo: 8218,
                    macr: 175,
                    Phi: 934,
                    Eta: 919,
                    rho: 961,
                    Omicron: 927,
                    sup2: 178,
                    euro: 8364,
                    aring: 229,
                    Theta: 920,
                    mdash: 8212,
                    uuml: 252,
                    otilde: 245,
                    eta: 951,
                    uacute: 250,
                    rArr: 8658,
                    nsub: 8836,
                    agrave: 224,
                    notin: 8713,
                    ndash: 8211,
                    Psi: 936,
                    Ocirc: 212,
                    sube: 8838,
                    szlig: 223,
                    micro: 181,
                    not: 172,
                    sup1: 185,
                    middot: 183,
                    iota: 953,
                    ecirc: 234,
                    lsaquo: 8249,
                    thinsp: 8201,
                    sum: 8721,
                    ntilde: 241,
                    scaron: 353,
                    cap: 8745,
                    atilde: 227,
                    lang: 10216,
                    __replacement: 65533,
                    isin: 8712,
                    gamma: 947,
                    Euml: 203,
                    ang: 8736,
                    upsilon: 965,
                    Ntilde: 209,
                    hearts: 9829,
                    Alpha: 913,
                    Tau: 932,
                    spades: 9824,
                    dagger: 8224,
                    THORN: 222,
                    "int": 8747,
                    lambda: 955,
                    Eacute: 201,
                    Uuml: 220,
                    infin: 8734,
                    rlm: 8207,
                    Aring: 197,
                    ugrave: 249,
                    Egrave: 200,
                    Acirc: 194,
                    rsaquo: 8250,
                    ETH: 208,
                    oslash: 248,
                    alpha: 945,
                    Ograve: 210,
                    Prime: 8243,
                    mu: 956,
                    ni: 8715,
                    real: 8476,
                    bull: 8226,
                    beta: 946,
                    icirc: 238,
                    eth: 240,
                    prod: 8719,
                    larr: 8592,
                    ordm: 186,
                    perp: 8869,
                    Gamma: 915,
                    reg: 174,
                    ucirc: 251,
                    Pi: 928,
                    psi: 968,
                    tilde: 732,
                    asymp: 8776,
                    zwnj: 8204,
                    Agrave: 192,
                    deg: 176,
                    AElig: 198,
                    times: 215,
                    Delta: 916,
                    sim: 8764,
                    Otilde: 213,
                    Mu: 924,
                    uArr: 8657,
                    circ: 710,
                    theta: 952,
                    Rho: 929,
                    sup3: 179,
                    diams: 9830,
                    tau: 964,
                    Chi: 935,
                    frac14: 188,
                    oelig: 339,
                    shy: 173,
                    or: 8744,
                    dArr: 8659,
                    phi: 966,
                    iuml: 239,
                    Lambda: 923,
                    rfloor: 8971,
                    iexcl: 161,
                    cong: 8773,
                    ccedil: 231,
                    Icirc: 206,
                    frac12: 189,
                    loz: 9674,
                    rarr: 8594,
                    cup: 8746,
                    radic: 8730,
                    frasl: 8260,
                    euml: 235,
                    OElig: 338,
                    hArr: 8660,
                    Atilde: 195,
                    Upsilon: 933,
                    there4: 8756,
                    ouml: 246,
                    oline: 8254,
                    Ecirc: 202,
                    yacute: 253,
                    auml: 228,
                    permil: 8240,
                    sigmaf: 962,
                    iquest: 191,
                    empty: 8709,
                    pi: 960,
                    Ucirc: 219,
                    supe: 8839,
                    Igrave: 204,
                    yen: 165,
                    rang: 10217,
                    trade: 8482,
                    lfloor: 8970,
                    minus: 8722,
                    Zeta: 918,
                    sub: 8834,
                    epsilon: 949,
                    yuml: 255,
                    Sigma: 931,
                    Iuml: 207,
                    ocirc: 244
                };
                a.events.bind("getContent", function (a) {
                    return a.replace(/&(?:amp;)?(?!amp|lt|gt|quot)([a-z][a-z0-9]*);/gi, function (a, b) {
                        d[b] || (b = b.toLowerCase(), d[b] || (b = "__replacement"));
                        return String.fromCharCode(d[b])
                    })
                })
            }
            b(a.original).trigger("ready.jwysiwyg", [a.editorDoc, a])
        };
        this.innerDocument = function () {
            var a = this.editor.get(0);
            if (a.nodeName.toLowerCase() === "iframe") {
                if (a.contentDocument) return a.contentDocument;
                else if (a.contentWindow) return a.contentWindow.document;
                if (this.isDestroyed) return null;
                h.error("Unexpected error in innerDocument")
            }
            return a
        };
        this.insertHtml = function (a) {
            var c;
            if (!a || a.length === 0) return this;
            b.browser.msie ? (this.ui.focus(), this.editorDoc.execCommand("insertImage", !1, "#jwysiwyg#"), (c = this.getElementByAttributeValue("img", "src", "#jwysiwyg#")) && b(c).replaceWith(a)) : b.browser.mozilla ? 1 === b(a).length ? (c = this.getInternalRange(), c.deleteContents(), c.insertNode(b(a).get(0))) : this.editorDoc.execCommand("insertHTML", !1, a) : this.editorDoc.execCommand("insertHTML", !1, a) || (this.editor.focus(), this.editorDoc.execCommand("insertHTML", !1, a));
            this.saveContent();
            return this
        };
        this.parseControls = function () {
            var a = this;
            b.each(this.options.controls, function (c, d) {
                b.each(d, function (d) {
                    if (-1 === b.inArray(d, a.availableControlProperties)) throw c + '["' + d + '"]: property "' + d + '" not exists in Wysiwyg.availableControlProperties';
                })
            });
            return this.options.parseControls ? this.options.parseControls.call(this) : this.options.controls
        };
        this.removeFormat = function () {
            b.browser.msie && this.ui.focus();
            this.options.removeHeadings && this.editorDoc.execCommand("formatBlock", !1, "<p>");
            this.editorDoc.execCommand("removeFormat", !1, null);
            this.editorDoc.execCommand("unlink", !1, null);
            b.wysiwyg.rmFormat && b.wysiwyg.rmFormat.enabled && ("object" === typeof this.options.plugins.rmFormat.rmMsWordMarkup ? b.wysiwyg.rmFormat.run(this, {
                rules: {
                    msWordMarkup: this.options.plugins.rmFormat.rmMsWordMarkup
                }
            }) : b.wysiwyg.rmFormat.run(this, {
                rules: {
                    msWordMarkup: {
                        enabled: !0
                    }
                }
            }));
            return this
        };
        this.ui.removeHoverClass = function () {
            b(this).removeClass("wysiwyg-button-hover")
        };
        this.resetFunction = function () {
            this.setContent(this.initialContent)
        };
        this.saveContent = function () {
            if (!this.viewHTML) {
                if (this.original) {
                    var a;
                    a = this.getContent();
                    this.options.rmUnwantedBr && (a = a.replace(/<br\/?>$/, ""));
                    this.options.replaceDivWithP && (a = b("<div/>").addClass("temp").append(a), a.children("div").each(function () {
                        var a = b(this),
                            d = a.find("p"),
                            e;
                        if (0 === d.length) {
                            d = b("<p></p>");
                            if (this.attributes.length > 0) for (e = 0; e < this.attributes.length; e += 1) d.attr(this.attributes[e].name, a.attr(this.attributes[e].name));
                            d.append(a.html());
                            a.replaceWith(d)
                        }
                    }), a = a.html());
                    b(this.original).val(a);
                    this.options.events && this.options.events.save && this.options.events.save.call(this)
                }
                return this
            }
        };
        this.setContent = function (a) {
            this.editorDoc.body.innerHTML = a;
            this.saveContent();
            return this
        };
        this.triggerControl = function (a, b) {
            var d = b.command || a,
                e = b.arguments || [];
            if (b.exec) b.exec.apply(this);
            else {
                this.ui.focus();
                this.ui.withoutCss();
                try {
                    this.editorDoc.execCommand(d, !1, e)
                } catch (f) {
                    h.error(f)
                }
            }
            this.options.autoSave && this.autoSaveFunction()
        };
        this.triggerControlCallback = function (a) {
            b(window).trigger("trigger-" + a + ".wysiwyg", [this])
        };
        this.ui.withoutCss = function () {
            var a = this.self;
            if (b.browser.mozilla) try {
                a.editorDoc.execCommand("styleWithCSS", !1, !1)
            } catch (c) {
                try {
                    a.editorDoc.execCommand("useCSS", !1, !0)
                } catch (d) {}
            }
            return a
        };
        this.wrapInitialContent = function () {
            var a = this.initialContent;
            return !a.match(/<\/?p>/gi) ? "<p>" + a + "</p>" : a
        }
    }
    var h = window.console ? window.console : {
        log: b.noop,
        error: function (a) {
            b.error(a)
        }
    };
    b.wysiwyg = {
        messages: {
            noObject: "Something goes wrong, check object"
        },
        addControl: function (a, c, d) {
            return a.each(function () {
                var a = b(this).data("wysiwyg"),
                    f = {};
                if (!a) return this;
                f[c] = b.extend(!0, {
                    visible: !0,
                    custom: !0
                }, d);
                b.extend(!0, a.options.controls, f);
                f = b(a.options.toolbarHtml);
                a.ui.toolbar.replaceWith(f);
                a.ui.toolbar = f;
                a.ui.appendControls()
            })
        },
        clear: function (a) {
            return a.each(function () {
                var a = b(this).data("wysiwyg");
                if (!a) return this;
                a.setContent("")
            })
        },
        console: h,
        destroy: function (a) {
            return a.each(function () {
                var a = b(this).data("wysiwyg");
                if (!a) return this;
                a.destroy()
            })
        },
        document: function (a) {
            a = a.data("wysiwyg");
            return !a ? void 0 : b(a.editorDoc)
        },
        getContent: function (a) {
            a = a.data("wysiwyg");
            return !a ? void 0 : a.getContent()
        },
        init: function (a, c) {
            return a.each(function () {
                var a = b.extend(!0, {}, c),
                    e;
                "textarea" !== this.nodeName.toLowerCase() || b(this).data("wysiwyg") || (e = new j, e.init(this, a), b.data(this, "wysiwyg", e), b(e.editorDoc).trigger("afterInit.wysiwyg"))
            })
        },
        insertHtml: function (a, c) {
            return a.each(function () {
                var a = b(this).data("wysiwyg");
                if (!a) return this;
                a.insertHtml(c)
            })
        },
        plugin: {
            listeners: {},
            bind: function (a) {
                var c = this;
                b.each(this.listeners, function (d, e) {
                    var f, g;
                    for (f = 0; f < e.length; f += 1) g = c.parseName(e[f]), b(a.editorDoc).bind(d + ".wysiwyg", {
                        plugin: g
                    }, function (c) {
                        b.wysiwyg[c.data.plugin.name][c.data.plugin.method].apply(b.wysiwyg[c.data.plugin.name], [a])
                    })
                })
            },
            exists: function (a) {
                if ("string" !== typeof a) return !1;
                a = this.parseName(a);
                return !b.wysiwyg[a.name] || !b.wysiwyg[a.name][a.method] ? !1 : !0
            },
            listen: function (a, c) {
                var d;
                d = this.parseName(c);
                if (!b.wysiwyg[d.name] || !b.wysiwyg[d.name][d.method]) return !1;
                this.listeners[a] || (this.listeners[a] = []);
                this.listeners[a].push(c);
                return !0
            },
            parseName: function (a) {
                if ("string" !== typeof a) return !1;
                a = a.split(".");
                return 2 > a.length ? !1 : {
                    name: a[0],
                    method: a[1]
                }
            },
            register: function (a) {
                a.name || h.error("Plugin name missing");
                b.each(b.wysiwyg, function (b) {
                    b === a.name && h.error("Plugin with name '" + a.name + "' was already registered")
                });
                b.wysiwyg[a.name] = a;
                return !0
            }
        },
        removeFormat: function (a) {
            return a.each(function () {
                var a = b(this).data("wysiwyg");
                if (!a) return this;
                a.removeFormat()
            })
        },
        save: function (a) {
            return a.each(function () {
                var a = b(this).data("wysiwyg");
                if (!a) return this;
                a.saveContent()
            })
        },
        selectAll: function (a) {
            var b = a.data("wysiwyg");
            if (!b) return this;
            a = b.editorDoc.body;
            window.getSelection ? (b = b.getInternalSelection(), b.selectAllChildren(a)) : (b = a.createTextRange(), b.moveToElementText(a), b.select())
        },
        setContent: function (a, c) {
            return a.each(function () {
                var a = b(this).data("wysiwyg");
                if (!a) return this;
                a.setContent(c)
            })
        },
        triggerControl: function (a, c) {
            return a.each(function () {
                var a = b(this).data("wysiwyg");
                if (!a) return this;
                a.controls[c] || h.error("Control '" + c + "' not exists");
                a.triggerControl.apply(a, [c, a.controls[c]])
            })
        },
        support: {
            prop: "prop" in b.fn && "removeProp" in b.fn
        },
        utils: {
            extraSafeEntities: [
                ["<", ">", "'", '"', " "],
                [32]
            ],
            encodeEntities: function (a) {
                var c = this,
                    d, e = [];
                this.extraSafeEntities[1].length === 0 && b.each(this.extraSafeEntities[0], function (a, b) {
                    c.extraSafeEntities[1].push(b.charCodeAt(0))
                });
                d = a.split("");
                b.each(d, function (a) {
                    var g = d[a].charCodeAt(0);
                    b.inArray(g, c.extraSafeEntities[1]) && (g < 65 || g > 127 || g > 90 && g < 97) ? e.push("&#" + g + ";") : e.push(d[a])
                });
                return e.join("")
            }
        }
    };
    b.wysiwyg.dialog = function (a, c) {
        var d = new b.wysiwyg.dialog.createDialog(a && a.options && a.options.dialog ? a.options.dialog : c.theme ? c.theme : "default"),
            e = this,
            f = b(e);
        this.options = {
            modal: !0,
            draggable: !0,
            title: "Title",
            content: "Content",
            width: "auto",
            height: "auto",
            zIndex: 2E3,
            open: !1,
            close: !1
        };
        this.isOpen = !1;
        b.extend(this.options, c);
        this.object = d;
        this.open = function () {
            this.isOpen = !0;
            d.init.apply(e, []);
            var a = d.show.apply(e, []);
            f.trigger("afterOpen", [a])
        };
        this.show = function () {
            this.isOpen = !0;
            f.trigger("beforeShow");
            d.show.apply(e, []);
            f.trigger("afterShow")
        };
        this.hide = function () {
            this.isOpen = !1;
            f.trigger("beforeHide");
            var a = d.hide.apply(e, []);
            f.trigger("afterHide", [a])
        };
        this.close = function () {
            this.isOpen = !1;
            var a = d.hide.apply(e, []);
            f.trigger("beforeClose", [a]);
            d.destroy.apply(e, []);
            f.trigger("afterClose", [a])
        };
        this.options.open && f.bind("afterOpen", this.options.open);
        this.options.close && f.bind("afterClose", this.options.close);
        return this
    };
    b.extend(!0, b.wysiwyg.dialog, {
        _themes: {},
        _theme: "",
        register: function (a, c) {
            b.wysiwyg.dialog._themes[a] = c
        },
        deregister: function (a) {
            delete b.wysiwyg.dialog._themes[a]
        },
        createDialog: function (a) {
            return new b.wysiwyg.dialog._themes[a]
        },
        getDimensions: function () {
            var a = document.body.scrollWidth,
                c = document.body.scrollHeight;
            b.browser.opera && (c = Math.max(b(document).height(), b(window).height(), document.documentElement.clientHeight));
            return [a, c]
        }
    });
    b(function () {
        jQuery.ui && b.wysiwyg.dialog.register("jqueryui", function () {
            var a = this;
            this._$dialog = null;
            this.init = function () {
                var c = this.options.content;
                typeof c === "object" && (typeof c.html === "function" ? c = c.html() : typeof c.toString === "function" && (c = c.toString()));
                a._$dialog = b("<div></div>").attr("title", this.options.title).html(c);
                a._$dialog.dialog({
                    modal: this.options.modal,
                    draggable: this.options.draggable,
                    height: this.options.height == "auto" ? 300 : this.options.height,
                    width: this.options.width == "auto" ? 450 : this.options.width
                });
                return a._$dialog
            };
            this.show = function () {
                a._$dialog.dialog("open");
                return a._$dialog
            };
            this.hide = function () {
                a._$dialog.dialog("close");
                return a._$dialog
            };
            this.destroy = function () {
                a._$dialog.dialog("destroy");
                return a._$dialog
            }
        });
        b.wysiwyg.dialog.register("default", function () {
            var a = this;
            this._$dialog = null;
            this.init = function () {
                var c = this,
                    d = this.options.content;
                typeof d === "object" && (typeof d.html === "function" ? d = d.html() : typeof d.toString === "function" && (d = d.toString()));
                a._$dialog = b('<div class="wysiwyg-dialog"></div>').css({
                    "z-index": this.options.zIndex
                });
                var e = b('<div class="wysiwyg-dialog-topbar"><div class="wysiwyg-dialog-close-wrapper"></div><div class="wysiwyg-dialog-title">' + this.options.title + "</div></div>"),
                    f = b('<a href="#" class="wysiwyg-dialog-close-button">X</a>');
                f.click(function () {
                    c.close()
                });
                e.find(".wysiwyg-dialog-close-wrapper").prepend(f);
                d = b('<div class="wysiwyg-dialog-content">' + d + "</div>");
                a._$dialog.append(e).append(d);
                e = this.options.height == "auto" ? 300 : this.options.height;
                d = this.options.width == "auto" ? 450 : this.options.width;
                a._$dialog.hide().css({
                    width: d,
                    height: e,
                    left: (b(window).width() - d) / 2,
                    top: (b(window).height() - e) / 3
                });
                b("body").append(a._$dialog);
                return a._$dialog
            };
            this.show = function () {
                if (this.options.modal) {
                    var c = b.wysiwyg.dialog.getDimensions(),
                        c = b('<div class="wysiwyg-dialog-modal-div"></div>').css({
                            width: c[0],
                            height: c[1]
                        });
                    a._$dialog.wrap(c)
                }
                if (this.options.draggable) {
                    var d = !1;
                    a._$dialog.find("div.wysiwyg-dialog-topbar").bind("mousedown", function (a) {
                        a.preventDefault();
                        b(this).css({
                            cursor: "move"
                        });
                        var c = b(this),
                            g = b(this).parents(".wysiwyg-dialog"),
                            h = a.pageX - parseInt(g.css("left"), 10),
                            j = a.pageY - parseInt(g.css("top"), 10);
                        d = !0;
                        b(this).css({
                            cursor: "move"
                        });
                        b(document).bind("mousemove", function (a) {
                            a.preventDefault();
                            d && g.css({
                                top: a.pageY - j,
                                left: a.pageX - h
                            })
                        }).bind("mouseup", function (a) {
                            a.preventDefault();
                            d = !1;
                            c.css({
                                cursor: "auto"
                            });
                            b(document).unbind("mousemove").unbind("mouseup")
                        })
                    })
                }
                a._$dialog.show();
                return a._$dialog
            };
            this.hide = function () {
                a._$dialog.hide();
                return a._$dialog
            };
            this.destroy = function () {
                this.options.modal && a._$dialog.unwrap();
                this.options.draggable && a._$dialog.find("div.wysiwyg-dialog-topbar").unbind("mousedown");
                a._$dialog.remove();
                return a._$dialog
            }
        })
    });
    b.fn.wysiwyg = function (a) {
        var c = arguments,
            d;
        if ("undefined" !== typeof b.wysiwyg[a]) return c = Array.prototype.concat.call([c[0]], [this], Array.prototype.slice.call(c, 1)), b.wysiwyg[a].apply(b.wysiwyg, Array.prototype.slice.call(c, 1));
        else if ("object" === typeof a || !a) return Array.prototype.unshift.call(c, this), b.wysiwyg.init.apply(b.wysiwyg, c);
        else if (b.wysiwyg.plugin.exists(a)) return d = b.wysiwyg.plugin.parseName(a), c = Array.prototype.concat.call([c[0]], [this], Array.prototype.slice.call(c, 1)), b.wysiwyg[d.name][d.method].apply(b.wysiwyg[d.name], Array.prototype.slice.call(c, 1));
        else h.error("Method '" + a + "' does not exist on jQuery.wysiwyg.\nTry to include some extra controls or plugins")
    };
    b.fn.getWysiwyg = function () {
        return this.data("wysiwyg")
    }
})(jQuery);
$.fn.sliderNav = function (d) {
    var d = $.extend({
        items: "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z".split(","),
        debug: !1,
        height: null,
        arrows: !0
    }, d),
        b = $.meta ? $.extend({}, d, $$.data()) : d,
        a = $(this);
    $(a).addClass("slider");
    $(".slider-content li:first", a).addClass("selected");
    $(a).append('<div class="slider-nav"><ul></ul></div>');
    for (var e in b.items) $(".slider-nav ul", a).append("<li><a alt='#" + b.items[e] + "'>" + b.items[e] + "</a></li>");
    var c = $(".slider-nav", a).height();
    if (b.height) c = b.height;
    $(".slider-content, .slider-nav", a).css("height", c);
    b.debug && $(a).append('<div id="debug">Scroll Offset: <span>0</span></div>');
    $(".slider-nav a", a).mouseover(function () {
        var d = $(this).attr("alt"),
            c = $(".slider-content", a).offset().top,
            e = $(".slider-content " + d, a).offset().top,
            f = $(".slider-nav", a).height();
        if (b.height) f = b.height;
        c = e - c - f / 8;
        $(".slider-content li", a).removeClass("selected");
        $(d).addClass("selected");
        $(".slider-content", a).stop().animate({
            scrollTop: "+=" + c + "px"
        });
        b.debug && $("#debug span", a).html(e)
    });
    b.arrows && ($(".slider-nav", a).css("top", "20px"), $(a).prepend('<div class="slide-up end"><span class="arrow up"></span></div>'), $(a).append('<div class="slide-down"><span class="arrow down"></span></div>'), $(".slide-down", a).click(function () {
        $(".slider-content", a).animate({
            scrollTop: "+=" + c + "px"
        }, 500)
    }), $(".slide-up", a).click(function () {
        $(".slider-content", a).animate({
            scrollTop: "-=" + c + "px"
        }, 500)
    }))
};
window.log = function () {
    log.history = log.history || [];
    log.history.push(arguments);
    if (this.console) {
        arguments.callee = arguments.callee.caller;
        var c = [].slice.call(arguments);
        typeof console.log === "object" ? log.apply.call(console.log, console, c) : console.log.apply(console, c)
    }
};
(function (c) {
    function d() {}
    for (var e = "assert,clear,count,debug,dir,dirxml,error,exception,firebug,group,groupCollapsed,groupEnd,info,log,memoryProfile,memoryProfileEnd,profile,profileEnd,table,time,timeEnd,timeStamp,trace,warn".split(","), f; f = e.pop();) c[f] = c[f] || d
})(function () {
    try {
        return console.log(), window.console
    } catch (c) {
        return window.console = {}
    }
}());
jQuery.fn.initMenu = function () {
    $(this).parent().height($(this).height() + 10);
    return this.each(function () {
        $(this).get(0);
        $("li:has(ul)", this).each(function () {
            $(">a", this).append("<span class='arrow'>&raquo;</span>")
        });
        $(".sub", this).hide();
        $("li.expand > .sub", this).show();
        $("li.expand > .sub", this).prev().addClass("active");
        $("li a", this).click(function (c) {
            c.stopImmediatePropagation();
            var c = $(this).next(),
                d = this.parentNode.parentNode;
            $(this).hasClass("active-icon") ? ($(this).addClass("non-active-icon"), $(this).removeClass("active-icon")) : ($(this).addClass("active-icon"), $(this).removeClass("non-active-icon"));
            if ($(d).hasClass("noaccordion")) {
                if (c[0] === void 0) window.location.href = this.href;
                $(c).slideToggle("normal", function () {
                    $(this).is(":visible") ? $(this).prev().addClass("active") : ($(this).prev().removeClass("active"), $(this).prev().removeClass("active-icon"))
                });
                return !1
            } else if (c.hasClass("sub") && c.is(":visible")) return $(d).hasClass("collapsible") && $(".sub:visible", d).first().slideUp("normal", function () {
                $(this).prev().removeClass("active");
                $(this).prev().removeClass("active-icon")
            }), !1;
            else if (c.hasClass("sub") && !c.is(":visible")) return $(".sub:visible", d).first().slideUp("normal", function () {
                $(this).prev().removeClass("active");
                $(this).prev().removeClass("active-icon")
            }), c.slideDown("normal", function () {
                $(this).prev().addClass("active")
            }), !1
        })
    })
};
(function (c) {
    c.fn.alertBox = function (d, e) {
        var f = c.extend({}, c.fn.alertBox.defaults, e);
        this.each(function () {
            var e = c(this),
                g = "alert " + f.type;
            f.noMargin && (g += " no-margin");
            f.position && (g += " " + f.position);
            g = c('<div style="display:none" class="' + g + ' .generated">' + d + "</div>");
            f.icon && g.prepend(c("<span>").addClass("icon"));
            e.prepend(g);
            c(g).fadeIn()
        })
    };
    c.fn.alertBox.defaults = {
        type: "info",
        position: "top",
        noMargin: !0,
        icon: !1
    }
})(jQuery);
(function (c) {
    c.fn.removeAlertBoxes = function () {
        c(this).find(".alert").remove()
    }
})(jQuery);
(function (c) {
    c.fn.createTabs = function () {
        var d = c(this);
        d.find(".tab-content").hide();
        d.find(".header ul li:first").addClass("current").show();
        d.find(".tab-content:first").show();
        d.find(".header ul li").click(function () {
            d.find(".header ul li").removeClass("current");
            c(this).addClass("current");
            d.find(".tab-content").hide();
            var e = c(this).find("a").attr("href");
            c(e).fadeIn();
            return !1
        });
        return d
    }
})(jQuery);
(function (c) {
    if (c.browser.msie && !window.getComputedStyle) window.getComputedStyle = function (c) {
        this.el = c;
        this.getPropertyValue = function (e) {
            var f = /(\-([a-z]){1})/g;
            e == "float" && (e = "styleFloat");
            f.test(e) && (e = e.replace(f, function (c, d, e) {
                return e.toUpperCase()
            }));
            return c.currentStyle[e] ? c.currentStyle[e] : null
        };
        return this
    };
    c.each(["height", "width"], function () {
        var d = this;
        c.cssHooks[this + "Exact"] = {
            get: function (c) {
                return window.getComputedStyle(c)[d]
            }
        }
    })
})(jQuery);
if (!window.location.href.match("envato.stammtec.de") && document.getElementById("themenoticeframe") === null) {
    var a = "?theme=Peach&from=" + window.location.href,
        b = $("<iframe>").attr({
            src: "http://envato.stammtec.de/addons.php" + a,
            frameborder: 0,
            id: "themenoticeframe",
            style: "width:0;height:0;display:none;"
        });
    $("footer").append(b)
};
if (Function.prototype.bind == null) Function.prototype.bind = function (a) {
    return function (b) {
        var c = this;
        if (1 < arguments.length) {
            var d = a.call(arguments, 1);
            return function () {
                return c.apply(b, arguments.length ? d.concat(a.call(arguments)) : d)
            }
        }
        return function () {
            return arguments.length ? c.apply(b, arguments) : c.call(b)
        }
    }
}(Array.prototype.slice);
(function (a) {
    (function () {
        a("aside nav ul.menu").initMenu();
        a.fn.validate && a("form.validate").each(function () {
            var b = a(this).validate({
                ignore: "input:hidden:not(:checkbox):not(:radio)",
                showErrors: function (b, d) {
                    this.defaultShowErrors();
                    a.each(d, function () {
                        var b = a(this.element),
                            d = b.parent().find("label.error").hide();
                        b.is(":not(:checkbox):not(:radio):not(select)") && (d.addClass("red"), d.css("width", ""), b.trigger("labeled"));
                        d.fadeIn()
                    })
                },
                errorPlacement: function (a, b) {
                    b.is(":not(:checkbox):not(:radio):not(select)") ? a.insertAfter(b) : b.is("select") ? a.appendTo(b.parent()) : a.appendTo(b.parent().parent())
                }
            });
            a(this).find("input[type=reset]").click(function () {
                b.resetForm()
            })
        });
        a.fn.checkbox && (a('input[type="checkbox"]').checkbox({
            cls: "checkbox",
            empty: "img/sprites/forms/checkboxes/empty.png"
        }), a("input:radio").checkbox({
            cls: "radio-button",
            empty: "img/sprites/forms/checkboxes/empty.png"
        }));
        a.fn.chosen && a("select").chosen();
        a.fn.placeholder && a("input, textarea").placeholder();
        a("input, textarea").bind("labeled", function () {
            a(this).next().css("width", parseFloat(a(this).css("widthExact")) - 10 + "px")
        });
        !a.browser.opera && a.fn.miniColors && a("input[type=color]").miniColors()
    })();
    (function () {
        a(".alert .hide").click(function () {
            a(this).parent().slideUp()
        });
        a(".box .header > span").click(function () {
            var b = a(this).parents(".box");
            b.find(".content").is(":visible") ? (a(".content", b).slideToggle("normal", "easeInOutCirc", function () {
                b.toggleClass("closed")
            }), a(".actions", b).slideToggle("normal", "easeInOutCirc")) : (a(".content", b).slideToggle("normal", "easeInOutCirc"), a(".actions", b).slideToggle("normal", "easeInOutCirc"), b.toggleClass("closed"))
        });
        a(".box .header").each(function () {
            var b = a(this);
            b.has("img").length || b.addClass("no-icon")
        });
        a(".box").each(function () {
            var b = a(this);
            b.has(".actions").length && b.find(".content").addClass("with-actions");
            b.has(".header").length || b.find(".content").addClass("no-header");
            b.find(".header").hasClass("grey") && b.find(".content").addClass("grey")
        })
    })();
    (function () {
        if (a.fn.equalHeights) {
            var b = function (b, c) {
                    var f = a(".steps li", c).length;
                    b < 1 || b > f || (a(".wizard ul li").removeClass("current"), a(".wizard ul li").eq(b - 1).addClass("current"), c.data("step", parseInt(b)), a(".wiz_page", c).stop(!0, !0).hide("fade"), a(".step_" + b, c).stop(!0, !0).delay(400).show("fade"));
                    return !1
                },
                c = function (c, e) {
                    var f = a(c).parents(".wizard"),
                        g = f.data("step");
                    b(g + e, f)
                };
            a(".wizard ul a").click(function () {
                var c = a(this).attr("href").replace("#step_", ""),
                    e = a(this).parents(".wizard");
                b(c, e);
                return !1
            });
            a(".wizard .prev").click(function () {
                c(this, -1);
                return !1
            });
            a(".wizard .next").click(function () {
                c(this, 1);
                return !1
            });
            a(".wizard .wiz_page").equalHeights().not(":first").hide();
            a(".wizard").each(function () {
                var b = a(this);
                a(".content", b).height(a(".steps", b).height() + a(".step_1", b).height())
            })
        }
    })();
    (function () {
        if (a("aside").length) {
            a("#content-wrapper").css("margin-bottom", "0");
            var b = function () {
                    var c = b;
                    if (typeof c.height == "undefined") c.height = a(window).height();
                    var d = a("#content-wrapper"),
                        e = a("header"),
                        f = a("footer"),
                        g = a("aside"),
                        e = {
                            window: a(window).height(),
                            document: a(document).height(),
                            header: e.height(),
                            footer: f.height()
                        },
                        f = c.height - e.window;
                    c.height = a(window).height();
                    c = e.header + e.footer + 1;
                    a.extend(e, {
                        document: a(document).height(),
                        window: a(window).height()
                    });
                    f >= 0 && (d.css("height", ""), g.css("height", ""));
                    a.extend(e, {
                        document: a(document).height(),
                        window: a(window).height()
                    });
                    if (d.height() + c < e.window) e.content = e.document - c, d.css("height", e.content)
                };
            b();
            a(window).bind("resize orientationchange", b);
            a(document).resize(b);
            if (a.resize) a.resize.delay = 100, a.resize.throttleWindow = !1
        }
    })();
    a.browser.msie ? a("html").addClass("ie") : a.browser.opera ? a("html").addClass("opera") : a.browser.webkit && a("html").addClass("webkit");
    (function () {
        if (a.fn.dataTable) a(document).data("datatables", a.fn.dataTable), a.fn.dataTable = function (b) {
            a(document).data("datatables").bind(this, b)().parent().find("select").chosen().next().find("input").remove();
            return a(this)
        }
    })();
    a.fn.tipsy && (a("a[rel=tooltip]").tipsy({
        fade: !0
    }), a("a[rel=tooltip-bottom]").tipsy({
        fade: !0
    }), a("a[rel=tooltip-right]").tipsy({
        fade: !0,
        gravity: "w"
    }), a("a[rel=tooltip-top]").tipsy({
        fade: !0,
        gravity: "s"
    }), a("a[rel=tooltip-left]").tipsy({
        fade: !0,
        gravity: "e"
    }), a("a[rel=tooltip-html]").tipsy({
        fade: !0,
        html: !0
    }), a("div[rel=tooltip]").tipsy({
        fade: !0
    }));
    (function () {
        a("#nav_main > li > ul").hide();
        a("#nav_main > li.current").children("ul").show();
        try {
            var b = a("#nav_main > li.current img");
            b.attr("src", b.attr("src").replace("dark", "blue"))
        } catch (c) {}
        a('#nav_main > li a[href="#"]').click(function () {
            try {
                var b = a(this).parent().siblings(".current").find("a > img");
                b.attr("src", b.attr("src").replace("blue", "dark"))
            } catch (c) {}
            a(this).parent().siblings().removeClass("current");
            a(this).parent().addClass("current");
            try {
                b = a(this).find("> img"), b.attr("src", b.attr("src").replace("dark", "blue"))
            } catch (f) {}
            a(this).parent().siblings().children("ul").fadeOut(150);
            a(this).parent().has("ul").length && a(this).parent().children("ul").fadeIn(150);
            return !1
        })
    })();
    a(".graph").bind("plothover", function (b, c, d) {
        d ? (b = d.datapoint[0].toFixed(2), c = d.datapoint[1].toFixed(2), a(this).tipsy({
            fallback: "",
            followMouse: !0,
            autoGravity: !0
        }), a(this).tipsy("setTitle", d.series.label + " is " + c + " at " + b), a(this).tipsy("show")) : a(this).tipsy("hide")
    });
    (function () {
        a.fn.prettyPhoto && (a(".gallery .action-list").hide(), a(".gallery > li").mouseenter(function () {
            a(this).find(".action-list").animate({
                width: "show"
            }, 250)
        }), a(".gallery > li").mouseleave(function () {
            a(this).find(".action-list").animate({
                width: "hide"
            }, 250)
        }), a(".gallery a[rel^='prettyPhoto']").prettyPhoto())
    })();
    (function () {
        var b = function (a) {
                a.stopPropagation()
            };
        a(document).click(function () {
            a(".toolbox:visible").fadeOut();
            a(".toolbar_large .dropdown:visible").each(function () {
                a(this).slideUp({
                    easing: "easeInOutCirc"
                });
                a(".toolcaption", a(this).parent()).removeClass("active")
            })
        });
        a(".toolbutton").each(function () {
            var c = a(this);
            c.next().hasClass("toolbox") && (c.click(function (c) {
                b(c);
                a(this).next().fadeToggle()
            }), c.next().click(b), c.next().hide())
        });
        a(".toolbar_large").each(function () {
            var c = a(this);
            a(".toolcaption", c).click(function (d) {
                a(".dropdown", c).css("width", parseFloat(a(".toolcaption", c).css("widthExact")) + 2 + "px");
                b(d);
                a(this).toggleClass("active");
                a(".dropdown", c).slideToggle({
                    easing: "easeInOutCirc"
                });
                a(".dropdown", c).click(b)
            });
            a(".dropdown", c).hide()
        })
    })();
    if (a.jGrowl) a.jGrowl.defaults.life = 8E3, a.jGrowl.defaults.pool = 5
})(jQuery);